Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[10] = { 1,2,3,4,5,6,7,8,9,0 };
- int b[10] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
- int c[10];
- int i, j, k;
- int main()
- {
- for (k = 0; k < 10; k++) {
- if (k % 2 == 0)
- for (i = 0; i < 10; i++)
- if (i % 2 == 1)
- c[k] = a[i];
- }
- for (k = 0; k < 10; k++) {
- if (k % 2 == 1)
- for (j = 0; j < 10; j++)
- if (j % 2 == 0)
- c[k] = b[j];
- }
- for (i = 0; i < 10; i++)
- cout << a[i] << endl;
- cout << "\n";
- for (j = 0; j < 10; j++)
- cout << b[j] << endl;
- cout << "\n";
- for (k = 0; k < 10; k++)
- cout << c[k]<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment