結果

問題 No.227 簡単ポーカー
ユーザー meshedgear
提出日時 2015-06-21 17:09:01
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 20,992 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-07 15:51:18
合計ジャッジ時間 812 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |                 scanf("%d", &cards[i]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	int i, j, cards[5], count[13] = {}, ver[4] = {}, a = 4;
	
	for(i = 0; 5 > i; i++){
		scanf("%d", &cards[i]);
		count[cards[i]]++;
	}
	for(i = 0; 13 > i; i++){
		ver[count[i]]++;
	}
	if(count[2] == 2) printf("TWO PAIR\n");
	else if(count[2] == 1 && count[3] == 1) printf("FULL HOUSE\n");
	else if(count[2] == 1) printf("ONE PAIR\n");
	else if(count[3] == 1) printf("THREE CARD\n");
	else printf("NO HAND\n");
	return 0;
}
0