main()
{int n,a[80],b[80],i,j;
scanf(“%d”,&n);
for(i=0;i<n;i++) scanf(“%d,%d”,&a[i],&b[i]);
for(i=1;i<n;i++)
for(j=0;j<n-i;j++) if(a[j]<a[j+1]) {a[j+1]^=a[j]^=a[j+1]^=a[j]; b[j+1]^=b[j]^=b[j+1]^=b[j];}
printf(“%d,%d %d,%d\n%d,%d %d,%d\n”,a[0],b[0],a[1],b[1],a[n-1],b[n-1],a[n-2],b[n-2]);}
>> 本文固定链接: http://www.vcgood.com/archives/3162
跪求,各位大哥大姐来帮帮忙吧
好像是疑异或的意思
不开辟空间交换a[j+1]和a[j]的值,相当于:
a = a^b;
b = b^a;
a = a^b;
谢谢了,有没有语句能替换的啊