Suppose that we have a deck of 52 cards (poker), the number is mapping A to 1, J to 11, Q to 12, and K to 13. Suppose that you are given 5 cards from the deck, and you should print the corresponding category to these five cards.
Note that you do not consider the colors.
Category:
1. Four of a kind (ex: 10 10 10 10 3)
2. Full house (ex: 9 9 9 2 2)
3. Two pair (ex: 5 5 6 6 8)
4. Nothing (ex: 8 7 1 9 5、4 1 8 8 8、2 3 4 5 6、7 7 2 8 6)
For example, you are giving the five cards are 8 3 8 3 8. Corresponding to the category is Full house, and you should print Full house as your output.
Hint:
#includeint main(void){ int card[5]; //the cards’ numbers of input int count[14] = {0}; //the amount of each number of the cards int twocount=0; //the count of pair int threecount=0; //the count of triple int fourcount=0; //the count of quadruple /* get the input and count the amount of each number of the input */ /* consider the category and print the output */ }
You are given the five cards and the number of the cards is from 1 to 13, which are separated by blanks.
The corresponding category to these five cards.
Remember to print a '\n' at the end of the answer.