方法一: int a = 1; int b = 2; a = a ^ b; b = a ^ b; a = a ^ b; 方法二: int a = 1; int b = 2; a= (a+b)-(b=a);