Advertisement
Ilya_konstantinov

is_even_blambda

Jan 28th, 2024
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | Source Code | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4.  
  5. using std::cin;
  6. using std::cout;
  7. using std::sort;
  8.  
  9. int main() {
  10.   int n; cin >> n;
  11.   std::vector<int> v(n);
  12.   for(int &el : v) cin >> el;
  13.   cout << std::count_if(v.begin(), v.end(), [](int a) {return (a%2) == 0;});
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement