#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main(void) {
char* ZUN = "ズン";
char* DOKO = "ドコ";
char* check[5];
for (int i=0; i<5; i++) { check[i] = ""; }
srand((unsigned) time(NULL));
while(1) {
char* s = (rand() % 2) == 0 ? ZUN : DOKO;
printf("%s ", s);
for (int i=0; i<4; i++) { check[i] = check[i + 1]; }
check[4] = s;
if (check[0] == ZUN &&
check[1] == ZUN &&
check[2] == ZUN &&
check[3] == ZUN &&
check[4] == DOKO)
{
break;
}
}
printf("キ・ヨ・シ!");
return 0;
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHRpbWUuaD4KCmludCBtYWluKHZvaWQpIHsKCWNoYXIqIFpVTiA9ICLjgrrjg7MiOwoJY2hhciogRE9LTyA9ICLjg4njgrMiOwoJCgljaGFyKiBjaGVja1s1XTsKCWZvciAoaW50IGk9MDsgaTw1OyBpKyspIHsgY2hlY2tbaV0gPSAiIjsgfQoJCglzcmFuZCgodW5zaWduZWQpIHRpbWUoTlVMTCkpOwoKCXdoaWxlKDEpIHsKCQljaGFyKiBzID0gKHJhbmQoKSAlIDIpID09IDAgPyBaVU4gOiBET0tPOwoJCXByaW50ZigiJXMgIiwgcyk7CgoJCWZvciAoaW50IGk9MDsgaTw0OyBpKyspIHsgY2hlY2tbaV0gPSBjaGVja1tpICsgMV07IH0KCQljaGVja1s0XSA9IHM7CgkJCgkJaWYgKGNoZWNrWzBdID09IFpVTiAmJgoJCSAgICBjaGVja1sxXSA9PSBaVU4gJiYKCQkgICAgY2hlY2tbMl0gPT0gWlVOICYmCgkJICAgIGNoZWNrWzNdID09IFpVTiAmJgoJCSAgICBjaGVja1s0XSA9PSBET0tPKQoJCXsKCSAgICAJYnJlYWs7CgkgICAgfQoJfQoJcHJpbnRmKCLjgq3jg7vjg6jjg7vjgrfvvIEiKTsKCXJldHVybiAwOwp9Cg==