Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- using std::cin;
- using std::cout;
- using std::sort;
- bool is_even(int a) { // Проверка четности
- return (a%2) == 0;
- }
- int main() {
- int n; cin >> n;
- std::vector<int> v(n);
- for(int &el : v) cin >> el;
- cout << std::count_if(v.begin(), v.end(), is_even);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement