#include int main() { int card[5]; int number[13]; scanf("%d %d %d %d %d", &card[0], &card[1], &card[2], &card[3], &card[4]); for (int i = 0; i < 13; i++) number[i] = 0; for (int i = 0; i < 5; i++) number[card[i] - 1]++; int ans = 0; for (int i = 0; i < 13; i++) { if (number[i] == 3) ans += 3; else if (number[i] == 2) ans += 2; } switch (ans) { case 5: printf("FULL HOUSE"); break; case 4: printf("THREE CARD"); break; case 3: printf("TWO PAIR"); break; case 2: printf("ONE PAIR"); break; default: printf("NO HAND"); break; } // 終了コードは0 return 0; }