Advertisement
Guest User

Untitled

a guest
May 25th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement