#include using namespace std; int main(int argc, char** argv) { typedef map CardMap; CardMap cmap; for (int ii=0; ii<5; ++ii){ int card; cin >> card; pair ib = cmap.insert( make_pair(card, 1) ); if (!ib.second) { ++ cmap[card]; } } int twoNum = 0; int threeNum = 0; CardMap::iterator it = cmap.begin(); for (; it!=cmap.end(); ++it) { if (it->second == 2) { ++ twoNum; } else if (it->second == 3) { ++ threeNum; } } if (twoNum==1 && threeNum==1) { cout << "FULL HOUSE" << endl; } else if (threeNum==1) { cout << "THREE CARD" << endl; } else if (twoNum==2) { cout << "TWO PAIR" << endl; } else if (twoNum==1) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }