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