fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. vector<int> v = { 1, 1, 2, 4, 6, 8};
  9. int count1 = count_if( v.begin(), v.end(),
  10. std::bind(logical_not<bool>(),
  11. std::bind(modulus<int>(), placeholders::_1, 2)));
  12. int count2 = count_if( v.begin(), v.end(), [](int x){return x % 2 == 0;});
  13. int what = -7%3;
  14. std::cout << count1 << "," << count2 << "," << what;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
4,4,-1