编程介的小学生 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
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题