Advertisement
LEGEND2004

Merge the sequences

Feb 26th, 2023 (edited)
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int n , m , k;
  6.     vector<int> v;
  7.     cin >> n;
  8.     while(n--){
  9.         cin >> k;
  10.         v.push_back(k);
  11.     }
  12.     cin >> m;
  13.     while(m--){
  14.         cin >> k;
  15.         v.push_back(k);
  16.     }
  17.     sort(v.begin() , v.end());
  18.     for(int i : v)
  19.         cout << i << " ";
  20.     cout << endl;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement