#include <stdio.h>
void swap(int *x,int *y){
int temp=*x;
*x=*y;
*y=temp;
}
int main(){
int data1[5]={1,2,3,4,5};
int data2[5]={6,7,8,9,10};
for(int i=0;i<5;i++){
swap(&data1[i],&data2[i]);
}
printf("data1:");
for(int i=0;i<5;i++){
printf("%d ",data1[i]);
}
printf("\n");
printf("data2:");
for(int i=0;i<5;i++){
printf("%d ",data2[i]);
}
printf("\n");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICp4LGludCAqeSl7CglpbnQgdGVtcD0qeDsKCSp4PSp5OwoJKnk9dGVtcDsKfQoKaW50IG1haW4oKXsKCWludCBkYXRhMVs1XT17MSwyLDMsNCw1fTsKCWludCBkYXRhMls1XT17Niw3LDgsOSwxMH07Cglmb3IoaW50IGk9MDtpPDU7aSsrKXsKCQlzd2FwKCZkYXRhMVtpXSwmZGF0YTJbaV0pOwoJfQoJcHJpbnRmKCJkYXRhMToiKTsKCWZvcihpbnQgaT0wO2k8NTtpKyspewoJCXByaW50ZigiJWQgIixkYXRhMVtpXSk7Cgl9CglwcmludGYoIlxuIik7CglwcmludGYoImRhdGEyOiIpOwoJZm9yKGludCBpPTA7aTw1O2krKyl7CgkJcHJpbnRmKCIlZCAiLGRhdGEyW2ldKTsKCX0KCXByaW50ZigiXG4iKTsKCXJldHVybiAwOwp9