Guest User

Untitled

a guest
Apr 9th, 2016
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int a[10] = { 1,2,3,4,5,6,7,8,9,0 };
  5. int b[10] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
  6. int c[10];
  7. int i, j, k;
  8.  
  9.  
  10. int main()
  11. {
  12.     for (k = 0; k < 10; k++) {
  13.         if (k % 2 == 0)
  14.             for (i = 0; i < 10; i++)
  15.                 if (i % 2 == 1)
  16.                     c[k] = a[i];
  17.     }
  18.  
  19.     for (k = 0; k < 10; k++) {
  20.         if (k % 2 == 1)
  21.             for (j = 0; j < 10; j++)
  22.                 if (j % 2 == 0)
  23.                     c[k] = b[j];
  24.     }
  25.  
  26.     for (i = 0; i < 10; i++)
  27.         cout << a[i] << endl;
  28.     cout << "\n";
  29.     for (j = 0; j < 10; j++)
  30.         cout << b[j] << endl;
  31.     cout << "\n";
  32.     for (k = 0; k < 10; k++)
  33.         cout << c[k]<<endl;
  34.     system("pause");
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment