加减法 #includestdio.hint main(){int a =3;int b=5;a=a+b;b=a-b;a=a-b;printf("%d\n%d",a,b);return 0;} 利用^(按位异或) #includestdio.h//int main(){int a =3;int b=5;a=a^b;b=a^b;a=a^b;printf("%d\n%d\n",a,b);return 0;}
加减法
#include<stdio.h>
int main(){
int a =3;
int b=5;
a=a+b;
b=a-b;
a=a-b;
printf("%d\n%d",a,b);
return 0;
}
利用^(按位异或)
#include<stdio.h>//
int main(){
int a =3;
int b=5;
a=a^b;
b=a^b;
a=a^b;
printf("%d\n%d\n",a,b);
return 0;
}