#include #include using namespace std; map input; int main() { //Count duplicated number int tmpIn = 0; for (size_t i = 0; i < 5; i++) { cin >> tmpIn; input[tmpIn]++; } //Count number of 2 or 3 set card int twoSetCnt = 0, threeSetCnt = 0; for (auto target : input) { if (target.second == 2) { twoSetCnt++; continue; } if (target.second == 3) { threeSetCnt++; } } #pragma region JudgeHand //FULL HOUSE if (threeSetCnt == 1 && twoSetCnt == 1) { cout << "FULL HOUSE" << "\n"; } //THREE CARD else if (threeSetCnt == 1) { cout << "THREE CARD" << "\n"; } //TWO PAIR else if (twoSetCnt == 2) { cout << "TWO PAIR" << "\n"; } //ONE PAIR else if (twoSetCnt == 1) { cout << "ONE PAIR" << "\n"; } else { //NOT MATCH cout << "NO HAND" << "\n"; } #pragma endregion #ifdef _DEBUG system("pause"); #endif // DEBUG return 0; }