結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-28 13:51:50 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 802 bytes |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 25,472 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-28 13:51:52 |
| 合計ジャッジ時間 | 1,328 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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(countCARD == 1 && countCARD == 1 || countPAIR == 2){
break;
}
}
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");
}
}
Maeda