#include #include using namespace std; string pair_card(int *card) { string ans[5] = {"FULL HOUSE","THREE CARD","TWO PAIR","ONE PAIR","NO HAND"}; int index = 4; for(int i = 0; i < 14; i++){ if(index > 3 && card[i] == 2){ index = 3; } else if(index == 3 && card[i] == 2){ index = 2; break; } else if(index == 3 && card[i] == 3){ index = 0; break; } else if(index == 1 && card[i] == 2){ index = 0; break; } else if(card[i] == 3){ index = 1; } } return ans[index]; } int main() { int card; int index[14] = {}; for(int i = 0;i < 5;i++){ cin >> card; card--; index[card]++; } cout << pair_card(index) << endl; return 0; }