#include #include using namespace std; int main() { int A; vector cnt( 14, 0 ); for( int i = 0; i < 5; i++ ) { cin >> A; cnt[A]++; } int pair = 0; int three = 0; for( int i = 1; i <= 13; i++ ) { switch( cnt[i] ) { case 2: pair++; break; case 3: three++; break; } } /* ある数をちょうど3つと、別の数をちょうど2つ含む。 */ if( three == 1 && pair == 1 ) { cout << "FULL HOUSE" << endl; return 0; } /*ある数をちょうど3つ含む。*/ if( three == 1 ) { cout << "THREE CARD" << endl; return 0; } if( pair == 2 ) { cout << "TWO PAIR" << endl; return 0; } if( pair == 1 ) { cout << "ONE PAIR" << endl; return 0; } cout << "NO HAND" << endl; return 0; }