fork download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8. int first[5] = {5,10,15,20,25};
  9. int second[5] = {50,40,30,20,10};
  10. int third[10];
  11.  
  12. merge(first, first + 5, second, second + 5, third);
  13.  
  14. for (int i = 0; i < 10; i++)
  15. cout << ' ' << third[i];
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
 5 10 15 20 25 50 40 30 20 10