【题目】如何不用任何额外变量交换两个整数的值
public class YiHuo {
public static void yihuo(int a, int b) {
a = a ^ b;
b = a ^ b;
a = a ^ b;
}
}
【题目】如何不用任何额外变量交换两个整数的值
public class YiHuo {
public static void yihuo(int a, int b) {
a = a ^ b;
b = a ^ b;
a = a ^ b;
}
}