int
a =
1
,b =
2
;
方法一:
a = a^b;
b = a^b;
a = a^b;
方法二:
a = a+b;
b = a-b;
a = a-b;
方法三:
int c;
c = a;
a = b;
b = c;
方法四:
a = a+b-(b=a);
方法五:
b = a+(a=b)*0;
方法六:
a = a*b;
b = a/b;
a = a/b;
方法一和方法三运行效率是最高的