Last active
January 28, 2017 06:36
-
-
Save ytone/02119d9df3f40de9dd5ab74f977103de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
プログラミング初級C/C++最終レポート | |
テーマ: 意地悪なじゃんけんゲーム | |
作成者: 早稲田大学国際教養学部1年 佐藤 | |
更新者: みんなのコード利根川 裕太 | |
作成日: 2017年1月25日 | |
*/ | |
#include <stdio.h> | |
string janken_detect(aite){ | |
if (aite == 1){ | |
return "私は、パーを出しました。残念、私の勝ちです!\n\n"; | |
} | |
if (aite == 2){ | |
return "私は、グーを出しました。残念、私の勝ちです!\n\n"; | |
} | |
if (aite == 3) { | |
return "私は、チョキを出しました。残念、私の勝ちです!\n\n"; | |
} | |
return "認識できません、私の不戦勝です!。\n\n"; | |
} | |
int main (){ | |
int n; | |
int k = 1 ; | |
while (n != 0){ | |
printf("\n最初はグー、じゃんけん…(グー: 1, チョキ: 2, パー:3)\n⇨ "); | |
scanf("%d",&aite); | |
printf(janken_detect(aite)); | |
printf("現在、%d連敗です!\n\n", k); | |
k++; | |
printf("もう一回じゃんけんしますか?(続ける場合: 1 続けない場合: 0)\n"); | |
scanf("%d",&n); | |
} | |
printf("\nまた、遊びに来て下さい!\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment