题目描述
循环相克令
样例
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
char ch1[]="Hunter";
char ch2[]="Bear";
char ch3[]="Gun";
char a[101],b[101];
for(int i=1;i<=n;i++)
{
scanf("%s %s",a,b);
if(strcmp(a,ch1)==0)
{
if(strcmp(b,ch1)==0)
printf("Tie\n");
else if(strcmp(b,ch2)==0)
printf("Player2\n");
else
printf("Player1\n");
}
else if(strcmp(a,ch2)==0)
{
if(strcmp(b,ch1)==0)
printf("Player1\n");
else if(strcmp(b,ch2)==0)
printf("Tie\n");
else
printf("Player2\n");
}
else if(strcmp(a,ch3)==0)
{
if(strcmp(b,ch1)==0)
printf("Player2\n");
else if(strcmp(b,ch2)==0)
printf("Player1\n");
else
printf("Tie\n");
}
}
return 0;
}