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