注意使用strcmp(ch,s)函数,按字典序比较字符串
#include <stdio.h>
#include <string.h>
int main()
{
int n,k=0;
char ch[10];
scanf("%d",&n);
getchar();
while(1)
{
scanf("%s",ch);
getchar();
if(strcmp(ch,"End")==0)
break;
k++;
if(k==n+1)
{
k=0;
printf("%s\n",ch);
}
else
{
if(strcmp(ch,"ChuiZi")==0)
printf("Bu\n");
else if(strcmp(ch,"JianDao")==0)
printf("ChuiZi\n");
else
printf("JianDao\n");
}
}
return 0;
}