#include <stdio.h>
void swap(int *x, int *y);
int main(void) {
int data1[5] = {1, 2, 3, 4, 5};
int data2[5] = {6, 7, 8, 9, 10};
int size = sizeof(data1) / sizeof(data1[0]);
for (int i = 0; i < size; i++) {
swap(&data1[i], &data2[i]);
}
for (int i = 0; i < size; i++) {
}
for (int i = 0; i < size; i++) {
}
return 0;
}
void swap(int *x, int *y) {
int temp;
temp = *x;
*x = *y;
*y = temp;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICp4LCBpbnQgKnkpOwoKaW50IG1haW4odm9pZCkgewogIAogICAgaW50IGRhdGExWzVdID0gezEsIDIsIDMsIDQsIDV9OwogICAgaW50IGRhdGEyWzVdID0gezYsIDcsIDgsIDksIDEwfTsKICAgIGludCBzaXplID0gc2l6ZW9mKGRhdGExKSAvIHNpemVvZihkYXRhMVswXSk7IAoKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CiAgICAgICAgc3dhcCgmZGF0YTFbaV0sICZkYXRhMltpXSk7IAogICAgfQoKICAgCiAgICBwcmludGYoImRhdGExOiAiKTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CiAgICAgICAgcHJpbnRmKCIlZCAiLCBkYXRhMVtpXSk7CiAgICB9CiAgICBwcmludGYoIlxuZGF0YTI6ICIpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKICAgICAgICBwcmludGYoIiVkICIsIGRhdGEyW2ldKTsKICAgIH0KICAgIHByaW50ZigiXG4iKTsKCiAgICByZXR1cm4gMDsKfQoKdm9pZCBzd2FwKGludCAqeCwgaW50ICp5KSB7CiAgICBpbnQgdGVtcDsKICAgIHRlbXAgPSAqeDsKICAgICp4ID0gKnk7CiAgICAqeSA9IHRlbXA7Cn0K