#include <iostream>
using namespace std;
constexpr int N = 10;
int a[N] = { 1,2,3,4,5,6,7,8,9,0 };
int b[N] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
int c[N];
void printArray(int* a, int length) {
for (int i = 0; i < length; ++i) {
cout << a[i] << "\t";
}
cout << endl;
}
int main() {
// your code goes here
for (int i = 0; i < N; ++i)
c[i] = (i%2 == 0 ? a[i+1] : b[i-1]);
printArray(a, N);
printArray(b, N);
printArray(c, N);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3RleHByIGludCBOID0gMTA7CgppbnQgYVtOXSA9IHsgMSwyLDMsNCw1LDYsNyw4LDksMCB9OwppbnQgYltOXSA9IHsgMTAsIDExLCAxMiwgMTMsIDE0LCAxNSwgMTYsIDE3LCAxOCwgMTl9OwppbnQgY1tOXTsKCnZvaWQgcHJpbnRBcnJheShpbnQqIGEsIGludCBsZW5ndGgpIHsKCWZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyArK2kpIHsKCQljb3V0IDw8IGFbaV0gPDwgIlx0IjsKCX0KCWNvdXQgPDwgZW5kbDsKfQoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkKCQljW2ldID0gKGklMiA9PSAwID8gYVtpKzFdIDogYltpLTFdKTsKCQoJcHJpbnRBcnJheShhLCBOKTsKCXByaW50QXJyYXkoYiwgTik7CglwcmludEFycmF5KGMsIE4pOwoJCglyZXR1cm4gMDsKfQ==