#include #include using namespace std; int main(void) { int s[5]; cin >> s[0] >> s[1] >> s[2] >> s[3] >> s[4]; int box[14]; //boxの0クリア for (int i = 0; i < 14; i++) { box[i] = 0; } //入力値をboxにカウントアップ //入力数値をそのまま配列の引数にするので13が溢れてしまうのでboxは14にする for (int i = 0; i < 5; i++) { box[s[i]]++; } int cntThree, cntTwo; cntThree = 0; cntTwo = 0; for (int i = 0; i < 14; i++) { if (box[i] == 3) { cntThree++; } else if (box[i] == 2) { cntTwo++; } } if (cntThree == 1 && cntTwo == 1) { cout << "FULL HOUSE" << endl; } else if (cntThree == 1) { cout << "THREE CARD" << endl; } else if (cntTwo == 2) { cout << "TWO PAIR" << endl; } else if (cntTwo == 1) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }