fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int i,j,n,m,k,t;
  6. char str[10];
  7. scanf("%d",&n);
  8. t=0;
  9. while(scanf("%s",str)&&strcmp(str,"End")!=0)
  10. {
  11. if(t==n)
  12. {
  13. printf("%s\n",str);
  14. t=0;
  15. }
  16. else
  17. {
  18. if(strcmp(str,"ChuiZi")==0)
  19. {
  20. printf("Bu\n");
  21. }
  22. else if(strcmp(str,"JianDao")==0)
  23. {
  24. printf("ChuiZi\n");
  25. }
  26. else if(strcmp(str,"Bu")==0)
  27. {
  28. printf("JianDao\n");
  29. }
  30. t++;
  31. }
  32.  
  33. }
  34. return 0;
  35.  
  36.  
  37. }
  38.  
Time limit exceeded #stdin #stdout 5s 9424KB
stdin
Standard input is empty
stdout
Standard output is empty