编程之中却有诸多美妙之处。
#include <STDIO.H>
int main()
{
int a,b;
printf("input the value of a and b:\n");
scanf("%d%d",&a,&b);
printf("before exchange:");
printf("a=%d\tb=%d\n",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after the 1st:");
printf("a=%d\tb=%d\n",a,b);
a=a^b;
b=b^a;
a=a^b;
printf("after the 2nd:");
printf("a=%d\tb=%d\n",a,b);
return 0;
}