#include <stdio.h>
void swap(int *x,int *y);
int main(void) {
// your code goes here
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[%d]=%d\n",i
,data1
[i
]); }
for(int i=0;i<5;i++){
printf("data2[%d]=%d\n",i
,data2
[i
]); }
return 0;
}
void swap(int*x,int*y){
int temp;
temp=*x;
*x=*y;
*y=temp;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICp4LGludCAqeSk7CmludCBtYWluKHZvaWQpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCWludCBkYXRhMVs1XT17MSwyLDMsNCw1fTsKCWludCBkYXRhMls1XT17Niw3LDgsOSwxMH07Cglmb3IoaW50IGk9MDtpPDU7aSsrKXsKCQlzd2FwKCZkYXRhMVtpXSwmZGF0YTJbaV0pOwoJCXByaW50ZigiZGF0YTFbJWRdPSVkXG4iLGksZGF0YTFbaV0pOwoJfQoJcHJpbnRmKCJcbiIpOwoJZm9yKGludCBpPTA7aTw1O2krKyl7CgkJcHJpbnRmKCJkYXRhMlslZF09JWRcbiIsaSxkYXRhMltpXSk7Cgl9CglyZXR1cm4gMDsKfQp2b2lkIHN3YXAoaW50KngsaW50KnkpewoJaW50IHRlbXA7Cgl0ZW1wPSp4OwoJKng9Knk7CgkqeT10ZW1wOwp9Cg==