1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 21:58:41 +00:00
202401-programming-assignments/【额外练习】选择结构/7-30 选择-硬币游戏.c

21 lines
481 B
C
Raw Normal View History

2024-10-30 15:00:18 +00:00
#include <stdio.h>
int main() {
int a, b;
scanf("%d%d", &a, &b);
// [Theorem]
// In a normal nim game, the player making the first move has a winning strategy
// if and only if the nim-sum of the sizes of the heaps is not zero. Otherwise,
// the second player has a winning strategy.
// Source: https://en.wikipedia.org/wiki/Nim
if ((a ^ b) == 0) {
printf("abcdxyzk\n");
} else {
printf("AekdyCoin\n");
}
return 0;
}