using System; using System.Collections.Generic; using System.IO; using System.Linq; public class Program { public static void Main(string[] args) { foreach(string arg in args) { Console.WriteLine(arg); } string result = proc(args); Console.WriteLine(result); } private static string proc(string[] args) { List cards = new List(); foreach (string arg in args) { cards.Add(int.Parse(arg)); } List result = Search(cards); string hand = string.Empty; if (result.Contains(3) && result.Contains(2)) { hand = "FULL HOUSE"; } else if (result.Contains(3)) { hand = "THREE CARD"; } else if (result.Count(num => num == 2) == 2) { hand = "TWO PAIR"; } else if (result.Count(num => num == 2) == 1) { hand = "ONE PAIR"; } else { hand = "NO HAND"; } return hand; } private static List Search(List cards) { List result = new List(); for (int i = 1; i <= 13; i++) { int count = 0; foreach (int card in cards) { if (card == i) { count++; } } Console.WriteLine("{0}, {1}", i, count); result.Add(count); } return result; } }