結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  zect518 | 
| 提出日時 | 2018-05-27 06:49:25 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 513 bytes | 
| コンパイル時間 | 107 ms | 
| コンパイル使用メモリ | 23,040 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-28 18:21:20 | 
| 合計ジャッジ時間 | 853 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 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++){
		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");
		}
	}
            
            
            
        