fork(3) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void)
  5.  
  6. {
  7.  
  8. int sta;
  9. char toi1[256], toi2[256], toi3[256], toi4[256], toi5[256];
  10. char toia[] = "int", toib[] = "double", toic[] = "char", toid[] = "printf", toie[] = "break";
  11.  
  12. printf("\n///////C言語でよく使う言葉タイピングゲーム///////\n");
  13. printf("(´・ω・`) HELLO!OMAERA! (´・ω・`)\n");
  14. printf("ゲームを始めるには 1 と入力したにEnterを押してね。 \n");
  15. scanf("\n%d", &sta);
  16.  
  17. if (sta == 1) {
  18. printf("表示される言葉を入力しよう。\n");
  19. printf("1問目 つ:%s\n", toia);
  20. scanf("%4s", toi1);
  21.  
  22. if (strcmp(toi1,toia) == 0) {
  23. printf("正解。次の問題だよ。\n");
  24. printf("2問目 つ:%s\n", toib);
  25. scanf("%7s", toi2);
  26.  
  27. if (strcmp(toi2, toib) == 0) {
  28. printf("正解。次の問題だよ。\n");
  29. printf("3問目 つ:%s\n", toic);
  30. scanf("%5s", toi3);
  31.  
  32. if (strcmp(toi3, toic) == 0) {
  33. printf("正解。次の問題だよ。\n");
  34. printf("4問目 つ:%s\n", toid);
  35. scanf("%6s", toi4);
  36.  
  37. if (strcmp(toi4, toid) == 0) {
  38. printf("正解。最後の問題だよ。 つ:%s\n", toie);
  39. scanf("%6s", toi5);
  40.  
  41. if (strcmp(toi5, toie) == 0) {
  42. printf("おめでとう!全問正解だ!何度も繰り返してタイピングマスターになろう!\n");
  43. printf("\n///// Staff Roll /////\nプログラム:>>1\n");
  44. printf("\n///// special thanks /////\n お前らの皆さん \n\n");
  45.  
  46. } else {
  47. printf("惜しい。もう一度挑戦しよう。\n");
  48. }
  49.  
  50. } else {
  51. printf("残念。またの挑戦を待っている。\n");
  52. }
  53.  
  54. } else {
  55. printf("頑張れ。負けるな。\n");
  56. }
  57.  
  58. } else {
  59. printf("残念。\n");
  60. }
  61.  
  62. } else {
  63. printf("間違いだよ。\n");
  64. }
  65.  
  66. } else {
  67. printf("終了します。\n");
  68. }
  69.  
  70. return 0;
  71. }
  72.  
Success #stdin #stdout 0s 2116KB
stdin
Standard input is empty
stdout
///////C言語でよく使う言葉タイピングゲーム///////
(´・ω・`)        HELLO!OMAERA!        (´・ω・`)
ゲームを始めるには 1 と入力したにEnterを押してね。 
終了します。