#include int sort(const void *a, const void *b) { return *(int*)a - *(int*)b; } using namespace std; int main(int argc, char **argv) { int S; //入力値 float a[1000]; //値の保管用 int i; //ループカウンタ for(i=0;i<5;i++) //入力 { scanf("%d",&S); a[i] = S; } for(i=0;i<5;i++) //sort { qsort(a,6,sizeof(int),sort); } //どの役にも該当しません。 if((a[0] == S) && (a[1] == S) && (a[2] == S) && (a[3] == S) && (a[4] == S) || (a[0] != a[1]) && (a[1] != a[2]) && (a[2] != a[3]) && (a[3] != a[4])) { printf("NO HAND\n"); } //FULL HOUSE else if((a[0] == a[1]) && (a[1] == a[2]) && (a[3] == a[4]) || (a[0] == a[1]) && (a[2] == a[3]) && (a[3] == a[4])) { printf("FULL HOUSE\n"); } //THREE CARD else if((a[0] == a[1]) && (a[1] == a[2]) || (a[2] == a[3]) && (a[3] == a[4])) { printf("THREE CARD\n"); } //ONE PAIR else if((a[0] == a[1]) || (a[1] == a[2]) || (a[2] == a[3]) || (a[3] == a[4])) { printf("ONE PAIR\n"); } return 0; }