import java.util.Arrays; import java.util.Scanner; import java.util.InputMismatchException; public class EasyPoker { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); try{ int[] array = new int[13]; for(int i = 0 ; i < 5 ; i++){ int X =scanner.nextInt(); array[X - 1]++; if(X < 1 || X > 13){ System.out.println("数字は1以上13以下で入力してください"); } } Arrays.sort(array); if(array[12] == 3){ if(array[11] == 2){ System.out.println("FULL HOUSE"); }else{ System.out.println("THREE CARD"); } }else if(array[12] == 2){ if(array[11] == 2){ System.out.println("TWO PAIR"); }else if(array[11] == array[10]){ System.out.println("ONE PAIR"); } }else{ System.out.println("NO HAND"); } }catch(InputMismatchException e){ System.out.println("数字を入力してください"); }catch(Exception E){ System.out.println("予期せぬエラーです"); } } }