結果

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

テストケース

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

ソースコード

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("TWO PAIR");
		break;
	case 3:
		printf("THREE CARD");
		break;
	case 2:
		printf("ONE PAIR");
		break;
	default:
		printf("NO HAND");
		break;
	}

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