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