AcWing 763. 循环相克令
原题链接
简单
作者:
霖霖_1
,
2024-10-24 15:32:35
,
所有人可见
,
阅读 1
#include <stdio.h>
#include <string.h>
int main() {
int t;
scanf("%d", &t);
char p1[10], p2[10];
for (int i = 0; i < t; i++) {
scanf("%s %s", p1, p2);
if (strcmp(p1, "Hunter") == 0) {
if (strcmp(p2, "Gun") == 0)
printf("Player1\n");
else if (strcmp(p2, "Bear") == 0)
printf("Player2\n");
else
printf("Tie\n");
} else if (strcmp(p1, "Bear") == 0) {
if (strcmp(p2, "Hunter") == 0)
printf("Player1\n");
else if (strcmp(p2, "Gun") == 0)
printf("Player2\n");
else
printf("Tie\n");
} else if (strcmp(p1, "Gun") == 0) {
if (strcmp(p2, "Hunter") == 0)
printf("Player2\n");
else if (strcmp(p2, "Bear") == 0)
printf("Player1\n");
else
printf("Tie\n");
}
}
return 0;
}