結果

問題 No.227 簡単ポーカー
ユーザー suppy193suppy193
提出日時 2015-06-24 16:39:50
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 632 bytes
コンパイル時間 835 ms
コンパイル使用メモリ 24,236 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-22 00:31:17
合計ジャッジ時間 1,785 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main(void) {
	int i, count_pair, count_three;
	int a, card[14] = {0};
	for(i = 0;i < 5;i++){
		scanf("%d", &a);
		card[a]++;
	}
	count_pair = 0;
	count_three = 0;
	for(i = 1;i <= 13;i++){
		switch(card[i]){
			case 1:
			case 2:
			count_pair++;
			break;
			case 3:
			count_three++;
			break;
			default:
			break;
		}
	}
	if(count_three == 1 && count_pair == 1){
		printf("FULL HOUSE\n");
	}
	else if(count_three == 1){
		printf("THREE CARD\n");
	}
	else if(count_pair == 2){
		printf("TWO PAIR\n");
	}
	else if(count_pair == 1){
		printf("ONE PAIR\n");
	}
	else{
		printf("NO HAND\n");
	}


	return 0;
}
0