fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. vector<int> temp{1,2,3,4,4,5};
  9. auto it = temp.begin();
  10. it = find(it, temp.end(), 3);
  11. temp.erase(it);
  12. temp.insert(it,6);
  13. cout << *it << endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
6