結果

問題 No.227 簡単ポーカー
ユーザー hachidesyuhachidesyu
提出日時 2019-05-17 10:53:37
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 55,992 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 07:13:51
合計ジャッジ時間 1,770 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main()
{
	int a[5];
	for (int i = 0; i < 5; i++) {
		cin >> a[i];
	}

	int count[5] = { 0 };
	for (int i = 0; i < 5; i++) {
		for (int j = 0; j < 5; j++) {
			if (a[i] == a[j])
				count[i]++;
		}
	}

	int sum = 0;
	for (int i = 0; i < 5; i++) {
		sum += count[i];
	}

	switch (sum) {
	case 13:
		cout << "FULL HOUSE" << endl;
		break;
	case 11:
		cout << "THREE CARD" << endl;
		break;
	case 9:
		cout << "TWO PAIR" << endl;
		break;
	case 7:
		cout << "ONE PAIR" << endl;
		break;
	default:
		cout << "NO HAND" << endl;
		break;
	}
}
0