编程介的小学生 2019-01-02 18:57 采纳率: 20.5%
浏览 324
已采纳

一个有关二十一点的计算的数字的问题,用C语言如何解决的讨论?

Problem Description
21 point,also named Black Jack, originated in France,has spread around the world.

21 point, a gambling game played by using poker,is also the only one which is able to win banker by using probability calculation.

--- Encyclopedia from good search

We define blackjack rules are as follows, which is different from the original rules slightly.

cards are as follows:

A 2 3 4 5 6 7 8 9 10 J Q K

A is as 1 point.

JQK are all as 10 points.

We assume that the casino prepared a lot of cards,that is, you can assume that the probability of getting each card is the same.

There are two players who were banker and Player.

They get two cards at first and can see the card each other.

Player operates first.

Every turn, he can bid or stop bidding.

If he bid, he can take a card from the deck.

Once the the points are over 21,he will lose at once,which is called "busting", otherwise he will bid until stopping bidding and turn to banker.

the rule of banker is the same as the player's.

If there is no "busting", the one who have higher points win.

If they have the same points,they get the tie.

Here is the task,we give you the cards that both people have gotten.

please judge whether the Player have more than 50% winning percentage,
if yes, output "YES", otherwise output,"NO".

Oh, yes, everyone is very smart.

Input
The first line of the input file contains an integer Test(Test<=100000), which indicates the number of test cases.

For each test case, there is a string with four characters. the first and the second char indicate the card of the player.and the others indicate the banker's.(we use ‘T’ instead of '10')

Output
For each case of data output "YES" or "NO", it indicates whether the Player have more than 50% winning percentage.

Sample Input
1
TTT9

Sample Output
YES
//it's clear that player will not bid, then the blanker has only 2/13 winning percentage.

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-10-04 08:08
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料