fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. vector<int> v = { 1, 2, 3, 45, 24, 10, 20, -90, 100, 18, 17, 15, 87 };
  8. cout << count_if(v.cbegin(), v.cend(), [](int i) { return i >= 10 && i <= 20;});
  9. }
  10.  
  11. //https://pt.stackoverflow.com/q/104151/101
Success #stdin #stdout 0s 4528KB
stdin
Standard input is empty
stdout
5