fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. unsigned int x = 123456789;
  6. unsigned int y = 362436069;
  7. unsigned int z = 521288629;
  8. unsigned int w = 88675123;
  9.  
  10. void seed(unsigned int a,unsigned int b,unsigned int c,unsigned int d) {
  11. if((a|b|c|d)==0)return;
  12. x=a;y=b;z=c;w=d;
  13. }
  14.  
  15. unsigned int randint(void) {
  16. unsigned int t;
  17. t = x ^ (x << 11);
  18. x = y; y = z; z = w;
  19. return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
  20. }
  21.  
  22. int main(void) {
  23. const char* str[4]={"阿","澄","佳","奈"};
  24. int prev[4]={};
  25. int count=0;
  26. int i;
  27. srand((unsigned int)time(NULL));
  28. seed(rand(),rand(),rand(),rand());
  29. for(i=0;i<4;i++) {
  30. prev[i]=randint()%4;
  31. printf("%s",str[prev[i]]);
  32. count++;
  33. }
  34. for(;;) {
  35. if(prev[0]==0 && prev[1]==1 && prev[2]==2 && prev[3]==3)break;
  36. for(i=1;i<4;i++)prev[i-1]=prev[i];
  37. prev[3]=randint()%4;
  38. printf("%s",str[prev[3]]);
  39. count++;
  40. }
  41. puts("\n\nあ、あ、あ、阿澄佳奈さんあすみいいいい~~~~~!!\n");
  42. printf("%d回目で阿澄佳奈しました。\n",count);
  43. return 0;
  44. }
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
阿阿奈澄澄阿澄澄佳阿奈阿阿澄阿奈澄奈佳奈阿佳奈佳奈佳阿奈阿奈奈阿奈奈奈阿佳阿奈澄阿澄澄奈澄澄澄阿澄阿奈阿阿奈佳奈澄澄奈奈阿阿佳奈佳奈佳奈奈阿阿奈阿阿奈佳阿澄奈佳澄澄澄阿奈佳澄澄阿佳阿奈澄澄阿奈奈奈澄澄澄佳佳佳澄阿阿佳澄佳佳奈阿阿澄奈佳奈阿阿佳澄奈澄澄澄阿阿阿奈阿奈佳佳澄澄佳澄奈阿佳奈澄奈阿澄奈奈阿阿阿奈奈阿阿澄佳奈

あ、あ、あ、阿澄佳奈さんあすみいいいい~~~~~!!

158回目で阿澄佳奈しました。