daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Dec 19th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //3.8
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <iterator>
  5. using namespace std;
  6.  
  7.  
  8. int main() {
  9.   int x, n, y, m;
  10.   cin>>x;
  11.  int *A=new int[x];
  12.  
  13.   for(int i=0 ; i<x ; i++){
  14.     cin >> n;
  15.     A[i] = n;
  16.   }
  17.  
  18.   cin>>y;
  19.   int *B=new int[y];
  20.  
  21.   for(int i=0 ; i<y ; i++){
  22.     cin>>m;
  23.     B[i] = m;
  24.   }
  25.  
  26.   int *C=new int[x+y];
  27.   for(int i=0 ; i<x ; i++){
  28.     C[i]=A[i];
  29.   }
  30.   for(int i=x ; i<x+y ; i++){
  31.     C[i]=B[i-x];
  32.   }
  33.   sort(C,C+x+y);
  34.   for(int i=0 ; i<x+y; i++){
  35.     cout<<C[i];
  36.     if(i<x+y-1) {
  37.       cout<<" ";
  38.     }
  39.  
  40.   }
  41.  
  42.   return 0;
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top