fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <time.h>
  4.  
  5. int main(void) {
  6. char* ZUN = "ズン";
  7. char* DOKO = "ドコ";
  8.  
  9. char* check[5];
  10. for (int i=0; i<5; i++) { check[i] = ""; }
  11.  
  12. srand((unsigned) time(NULL));
  13.  
  14. while(1) {
  15. char* s = (rand() % 2) == 0 ? ZUN : DOKO;
  16. printf("%s ", s);
  17.  
  18. for (int i=0; i<4; i++) { check[i] = check[i + 1]; }
  19. check[4] = s;
  20.  
  21. if (check[0] == ZUN &&
  22. check[1] == ZUN &&
  23. check[2] == ZUN &&
  24. check[3] == ZUN &&
  25. check[4] == DOKO)
  26. {
  27. break;
  28. }
  29. }
  30. printf("キ・ヨ・シ!");
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
ドコ ズン ドコ ズン ドコ ドコ ドコ ズン ドコ ドコ ズン ズン ズン ドコ ズン ズン ドコ ズン ドコ ドコ ズン ドコ ドコ ドコ ズン ドコ ズン ドコ ドコ ドコ ズン ズン ズン ドコ ズン ドコ ズン ドコ ズン ズン ズン ズン ズン ズン ドコ キ・ヨ・シ!