Foj 1504 Play Poker

Accept: 90    Submit: 263
Time Limit: 1000 mSec    Memory Limit : 32768 KB

 Problem Description

In poker, you have 5 cards. There are 10 kinds of poker hands (from highest to lowest):

1. royal flush -- ace, king, queen, jack and ten, all in the same suit
2. straight flush -- five cards of the same suit in sequence, such as 10,9,8,7,6 of clubs; ace can be counted both as the highest card or as the lowest card | A,2,3,4,5 of hearts is a straight flush. But 4,3,2,A,K of hearts is not a straight flush -- it's just a flush.
3. four of a kind -- four cards of the same rank, such as four kings.
4. full house -- three cards of one rank plus two cards of another rank
5. flush -- five cards of the same suit (but not a straight flush)
6. straight -- five cards in order -- just like the straight flush, but mixed suits
7. three of a kind -- three cards of the same rank and two kickers of different ranks.
8. two pairs -- two cards of one rank, two cards of another rank, and one more card
9. pair -- two cards of the same rank
10. high card -- none of the above
Write a program that will help you play poker by telling you what kind of hand you have.

 Input

The first line of input contains the number of test cases (no more than 20). Each test case consists of one line -- five space separated cards. Each card is represented by a two-letter (or digit) word. The first character is the rank (A,K,Q,J,T,9,8,7,6,5,4,3 or 2), the second character is the suit (S,H,D,C standing for spades, hearts, diamonds and clubs). The cards can be in any order (but they will not repeat).

 Output

For each test case output one line describing the type of a hand, exactly like in the list above.

 Sample Input

3
AH KH QH TH JH
KH 5S 3C 5C 7D
QH QD 2S QC 2C

 Sample Output

royal flush 
pair
full house
 
 
没玩过的人应该好好做这题, 做完就会玩了....
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值