SHARE
TWEET

Untitled

a guest May 25th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.     int * a = new int[n], *b = new int[n], *c = new int[2 * n];
  9.     for (int i = 0; i < n; ++i)
  10.         cin >> a[i];
  11.     for (int i = 0; i < n; ++i)
  12.         cin >> b[i];
  13.     for (int i = n - 1; i >= 0; --i) {
  14.         c[i * 2] = a[i];
  15.         c[i * 2 + 1] = b[i];
  16.     }
  17.     for (int i = 0; i < 2 * n; ++i)
  18.         cout << c[i] << ' ';
  19.     delete a, b, c;
  20. }
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