fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. vector<int> org = {1, 2, 3};
  8. vector<int> nnew = {4, 5};
  9.  
  10. copy(nnew.begin(), nnew.end(), back_inserter(org));
  11. for (int a : org) {
  12. cout << a << " ";
  13. }
  14. cout << '\n';
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
1 2 3 4 5