You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
288 B

package class06;
public class Code05_Nim {
// 保证arr是正数数组
public static void printWinner(int[] arr) {
int eor = 0;
for (int num : arr) {
eor ^= num;
}
if (eor == 0) {
System.out.println("后手赢");
} else {
System.out.println("先手赢");
}
}
}