fork(4) download
  1. #include <vector>
  2. #include <algorithm>
  3. #include <iostream>
  4. #include <iterator>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. std::vector<int> Array = {3,6,9,5,10,21,3,25,14,12,32,41,3,24,15,26,7,8,11,4};
  11.  
  12. Array.erase(remove_if(Array.begin(), Array.end(), [](int n) { return n > 9; }),
  13. Array.end());
  14. copy(Array.begin(), Array.end(), ostream_iterator<int>(cout, " "));
  15.  
  16. }
  17.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
3 6 9 5 3 3 7 8 4