#include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(i=a;i> a[i]; sort(a,a+5); if(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]); else if(a[1] == a[2] && a[1] == a[3] && a[1] == a[4]); else { for(i=0;i<3;i++) { if(a[i] == a[i+1] && a[i+1] == a[i+2] ) { b[c++] = 3; i += 2; } if(a[i] == a[i+1]) { b[c++] = 2;i++; } } if(a[i] == a[i+1]) { b[c++] = 2;i++; } } if(b[0] == 2 && b[1] == 3 || b[0] == 3 && b[1] == 2) puts("FULL HOUSE"); else if(b[0] == 3 || b[1] == 3) puts("THREE CARD"); else if(b[0] == 2 && b[1] == 2) puts("TWO PAIR"); else if(b[0] == 2 || b[1] == 2) puts("ONE PAIR"); else puts("NO HAND"); return 0; }