結果

問題 No.227 簡単ポーカー
ユーザー ReERishunReERishun
提出日時 2020-05-18 04:24:40
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 634 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 30,464 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 20:40:58
合計ジャッジ時間 851 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>

int main() {
	
	int card[5];
	int number[13];

	scanf("%d %d %d %d %d", &card[0], &card[1], &card[2], &card[3], &card[4]);

	for (int i = 0; i < 13; i++)
		number[i] = 0;
	
	for (int i = 0; i < 5; i++)
		number[card[i] - 1]++;

	int ans = 0;

	for (int i = 0; i < 13; i++) {
		if (number[i] == 3)
			ans += 3;
		else if (number[i] == 2)
			ans += 2;
	}

	switch (ans)
	{
	case 5:
		printf("FULL HOUSE");
		break;
	case 4:
		printf("THREE CARD");
		break;
	case 3:
		printf("TWO PAIR");
		break;
	case 2:
		printf("ONE PAIR");
		break;
	default:
		printf("NO HAND");
		break;
	}

	// 終了コードは0
	return 0;
}
0