用^来操作:
public static int[] exchangeAB(int[] AB){
AB[0] = AB[0] ^ AB[1];
AB[1] = AB[0] ^ AB[1];
AB[0] = AB[0] ^ AB[1];
return AB;
}
用^来操作:
public static int[] exchangeAB(int[] AB){
AB[0] = AB[0] ^ AB[1];
AB[1] = AB[0] ^ AB[1];
AB[0] = AB[0] ^ AB[1];
return AB;
}