結果

問題 No.264 じゃんけん
ユーザー takatea_2525takatea_2525
提出日時 2018-05-17 00:37:49
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 671 bytes
コンパイル時間 516 ms
コンパイル使用メモリ 84,036 KB
実行使用メモリ 4,572 KB
最終ジャッジ日時 2023-08-20 10:42:20
合計ジャッジ時間 1,043 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

enum
{
	rock =0,
	scissors,
	paper,
    max_num
};


void inputRPSjudg(int &n)
{
	for (;;) 
	{
		cin >> n;
		if (n < 0 || n>max_num)
		{
			cout << "もう一度入力\n" << endl;
			continue;
		}

		break;
	}

}

int main()
{

	int myputout = 0;
	int rivalputout = 0;
	
	inputRPSjudg(myputout);
	inputRPSjudg(rivalputout);


	if (myputout == rivalputout)
	{
		cout << "Drew\n" << endl;
	}
	else if (myputout == rock && rivalputout== scissors
			|| myputout == paper && rivalputout == rock
			|| myputout == scissors && rivalputout == paper)
	{
		cout << "Won\n" << endl;
	}
	else
	{
		cout << "Lost\n" << endl;
	}

	return 0;
}
0