//条件自己补充一下(太多了 (╥╯^╰╥) )(*/ω\*)
#include
#include
using namespace std;
pair
int num;
void read_cards()
{
printf("Enter a card:");
char s[20];
scanf("%s\n",s);
a[num++]=make_pair(s[0],s[1]);
}
void analyze_hand()
{
sort(a,a+5);
if(/*满足同花大顺的条件*/)
print_result(1);
else if(/*满足同花顺的条件*/)
print_result(2);
else if(/*满足四张的条件*/)
print_result(3);
else if(/*满足葫芦的条件*/)
print_result(4);
else if(/*满足同花的条件*/)
print_result(5);
else if(/*满足顺子的条件*/)
print_result(6);
else if(/*满足三张的条件*/)
print_result(7);
else if(/*满足两对的条件*/)
print_result(8);
else if(/*满足一对的条件*/)
print_result(9);
else if(/*满足其他牌的条件*/)
print_result(10);
}
void print_result(int x)
{
switch(x)
{
case 1:printf("Royal flush\n");break;
case 2:printf("Straight flush\n");break;
case 3:printf("Four of a kind\n");break;
case 4:printf("Full house\n");break;
case 5:printf("Fush\n");break;
case 6:printf("Straight\n");break;
case 7:printf("Three of a kind\n");break;
case 8:printf("Two pairs\n");break;
case 9:printf("Pair\n");break;
case 10:printf("High card\n");break;
}
}
int main()
{
read_cards();
analyze_hand();
return 0;
}