結果

問題 No.227 簡単ポーカー
ユーザー pirorirori_n712
提出日時 2018-07-12 00:46:56
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 827 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 115,928 KB
実行使用メモリ 27,428 KB
最終ジャッジ日時 2024-09-22 05:45:35
合計ジャッジ時間 2,010 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class No227{
    static void Main(){
        var a=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
        Array.Sort(a);
        var b=0;
        var c=0;
        for(int i=0;i<4;++i){
            if(a[i]!=a[i+1])
            {
                b++;
                c=(c==2)?c:0;
            }
            else{
              c=(c==2)?c:c+1;
            } 
        }
        string s;
        switch(b){
            case 1:
                s="FULL HOUSE";
            break;
            case 2:
                if(c==2)s="THREE CARD";
                else s="TWO PAIR";
            break;
            case 3:
                s="ONE PAIR";
            break;
            default:
                s="NO HAND";
            break;
        }
        Console.WriteLine(s);
    }
}
0