結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
![]() |
提出日時 | 2025-03-25 17:57:14 |
言語 | C (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 715 bytes |
コンパイル時間 | 505 ms |
コンパイル使用メモリ | 25,216 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-25 17:57:16 |
合計ジャッジ時間 | 1,396 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 14 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&card); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> void main(void) { int trump[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; int card = 0; for(int i = 0 ; i < 5 ; i++){ int card = 0; scanf("%d",&card); trump[card-1]++; } int countPAIR = 0,countCARD = 0; for(int i = 0 ; i < 13 ; i++){ if(trump[i] == 3){ countCARD++; }else if(trump[i] == 2){ countPAIR++; } } if(countPAIR == 1 && countCARD == 1){ printf("FULL HOUSE"); }else if(countCARD == 1){ printf("THREE CARD"); }else if(countPAIR == 2){ printf("TWO PAIR"); }else if(countPAIR == 1){ printf("ONE PAIR"); }else{ printf("NO HAND"); } }