fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4.  
  5.  
  6. int main () {
  7. int value = 1;
  8. std::vector<int> vec= {1,2,3,4,7,5,1,1};
  9. vec.erase(std::remove(vec.begin(),vec.end(),value),vec.end());
  10. for(const auto &el:vec)
  11. std::cout<<el<<" ";
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
2 3 4 7 5