fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. vector<int> x { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  9. remove_if(x.begin(), x.end(), [](int x){ return x % 2 == 0; });
  10.  
  11. for (int e : x)
  12. cout << e << ' ';
  13. cout << endl;
  14. }
Success #stdin #stdout 0s 4200KB
stdin
Standard input is empty
stdout
1 3 5 7 9 6 7 8 9 10