using System; namespace simplepoker { class Program { static void Main() { 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; } } } //A1とA5が一致する場合は5カード //A1とA4が云々 if (cards[0] == cards[4]) Console.WriteLine("NO HAND"); else if (cards[0] == cards[3]) Console.WriteLine("NO HAND"); //A1A4 else if (cards[0] == cards[2]) { //A4A5が同じか if (cards[3] == cards[4]) { Console.WriteLine("FULL HOUSE"); return; } Console.WriteLine("THREE CARD"); } //A1A2が同じか else if (cards[0] == cards[1]) { //A3A4が同じか if (cards[2] == cards[3]) { Console.WriteLine("TWO PAIR"); return; } Console.WriteLine("ONE PAIR"); } else //ブタ Console.WriteLine("NO HAND"); } } }