#define _USE_MATH_DEFINES //M_PI(π),M_SQRT2(√2) #include //std::cout, std::cin #include //std::string,std::to_string(C++11) #include //std::vector #include //std::valarray #include //std::sort #include //localtime_s #include //abs #include //abs,std::pow,sqrt,sin,cos,round,floor,ceil #include //std::ifstream,std::ofstream #include //std::setprecision,std::setw,std::setfill #include //std::random(C++11) #include //std::accumulate int main(void) { //test用 //std::ifstream in("test.txt"); //std::cin.rdbuf(in.rdbuf()); //const unsigned int MODULO = 1000000007; //MODULO 10^9+7用 std::vector A(5); for (int i = 0; i < 5; i++) { std::cin >> A[i]; } bool NH = false; bool TC = false; int OP = 0; int SC = 0; for (int i = 0; i < 5; i++) { switch (std::count(A.begin(), A.end(), A[i])) { case 1:SC++; break; case 2:OP++; break; case 3:TC = true; break; case 4:NH = true; i = 5; break; case 5:NH = true; i = 5; break; } } std::string ans; if (NH || SC >= 3) { ans = "NO HAND"; } else { if (OP == 2) { ans = "ONE PAIR"; } if (OP == 4) { ans = "TWO PAIR"; } if (TC) { ans = "THREE CARD"; } if (TC && OP == 2) { ans = "FULL HOUSE"; } } std::cout << ans << std::endl; }