#include <stdio.h>
void swap(int*x,int*y){
int z=*x;
*x=*y;
*y=z;
}
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++){
printf("data1[%d]=%d data2[%d]=%d\n",i
,data1
[i
],i
,data2
[i
]); }
for(int i=0;i<5;i++){
swap(&data1[i],&data2[i]);
printf("data1[%d]=%d data2[%d]=%d\n",i
,data1
[i
],i
,data2
[i
]); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50KngsaW50KnkpewoJaW50IHo9Kng7CgkqeD0qeTsKCSp5PXo7Cn0KCmludCBtYWluKCkgewoJaW50IGRhdGExWzVdPXsxLDIsMyw0LDV9OwoJaW50IGRhdGEyWzVdPXs2LDcsOCw5LDEwfTsKCXByaW50Zigi5aSJ5pu05YmNXG4iKTsKCWZvcihpbnQgaT0wO2k8NTtpKyspewoJCXByaW50ZigiZGF0YTFbJWRdPSVkIGRhdGEyWyVkXT0lZFxuIixpLGRhdGExW2ldLGksZGF0YTJbaV0pOwoJfQoJcHJpbnRmKCLlpInmm7TlvoxcbiIpOwoJZm9yKGludCBpPTA7aTw1O2krKyl7CgkJc3dhcCgmZGF0YTFbaV0sJmRhdGEyW2ldKTsKCQlwcmludGYoImRhdGExWyVkXT0lZCBkYXRhMlslZF09JWRcbiIsaSxkYXRhMVtpXSxpLGRhdGEyW2ldKTsKCX0KCglyZXR1cm4gMDsKfQo=