結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-08-09 14:09:34 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 489 bytes |
| コンパイル時間 | 363 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 08:14:50 |
| 合計ジャッジ時間 | 1,068 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
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", &a[i]);
| ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main() {
int a[5], ncnt[13] = {}, r3cnt = 0, r2cnt = 0, i;
for (i = 0; i < 5; i++) {
scanf("%d", &a[i]);
ncnt[a[i] - 1]++;
}
for (i = 0; i < 13; i++) {
if (ncnt[i] == 2) r2cnt++;
if (ncnt[i] == 3) r3cnt++;
}
if (r3cnt == 1 && r2cnt == 1) printf("FULL HOUSE\n");
else if (r3cnt == 1) printf("THREE CARD\n");
else if (r2cnt == 2) printf("TWO PAIR\n");
else if (r2cnt == 1) printf("ONE PAIR\n");
else printf("NO HAND\n");
return 0;
}
くれちー