結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
shirano_c
|
| 提出日時 | 2017-11-02 13:18:28 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,691 bytes |
| コンパイル時間 | 823 ms |
| コンパイル使用メモリ | 108,944 KB |
| 実行使用メモリ | 28,300 KB |
| 最終ジャッジ日時 | 2024-11-22 13:12:39 |
| 合計ジャッジ時間 | 1,876 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 14 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace simplepoker
{
class Program
{
static void Main(string[] args)
{
string nums = Console.ReadLine();
string[] nospaceNums = nums.Split(' ');
int[] cards = new int[5];
int first, end,temp = 0;
//int配列の中にstring配列の中身を入れる
for (int i = 0; i < nospaceNums.Length; i++)
{
cards[i] = Convert.ToInt32(nospaceNums[i]);
}
//cards配列の中身をバブルソート
for (first = 0; first < cards.Length; first++)
{
for (end=cards.Length-1;end>first;end--)
{
if (cards[end] < cards[end - 1])
{
temp = cards[end - 1];
cards[end - 1] = cards[end];
cards[end] = temp;
}
}
}
//A1A2A3が同じか
if (cards[0] == cards[1] && cards[1] == cards[2])
{
//A4A5が同じか
if (cards[3] == cards[4])
Console.WriteLine("FULL HOUSE");
Console.WriteLine("THREE CARD");
}
//A1A2が同じか
else if (cards[0] == cards[1])
{
//A3A4が同じか
if (cards[2] == cards[3])
Console.WriteLine("TWO PAIR");
Console.WriteLine("ONE PAIR");
}
else
//ブタ
Console.WriteLine("NO HAND");
Console.WriteLine();
}
}
}
shirano_c