結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
zect518
|
| 提出日時 | 2018-05-27 06:46:41 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 532 bytes |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 23,040 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 18:21:19 |
| 合計ジャッジ時間 | 720 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d",&card[i]);
| ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(){
int count=0,match2=0,match3=0,i,s;
int card[5];
setvbuf(stdout,NULL,_IONBF,0);
for(i=0;i<5;i++){
printf("入力");
scanf("%d",&card[i]);
}
for(i=0;i<5;i++){count=0;
for(s=0;s<5;s++){
if(card[i]==card[s])count++;
}
if(count==2)match2++;
if(count==3)match3++;
}
switch(match2){
case 4:
printf("TWO PAIR");
break;
case 2:
if(match3==3)printf("FULL HOUSE");
else printf("ONE PAIR");
break;
case 0:
if(match3==3)printf("THREE CARD");
else printf("NO HAND");
}
}
zect518