【PTA】 Shuffling Machine

该博客介绍了一个编程挑战,模拟自动洗牌机对54张卡片(包括52张普通牌和2张Joker)进行洗牌的过程。根据给定的随机顺序重复指定次数。博客提供了一个示例输入和输出,并解释了洗牌算法的实现思路,包括使用两个数组分别存储字符和数字,以及如何根据洗牌顺序进行数组元素的重新排列。
摘要由CSDN通过智能技术生成

7-43 Shuffling Machine(20 分)

Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with gamblers by performing inadequate shuffles, many casinos employ automatic shuffling machines. Your task is to simulate a shuffling machine.

The machine shuffles a deck of 54 cards according to a given random order and repeats for a given number of times. It is assumed that the initial status of a card deck is in the following order:

S1, S2, ..., S13, 
H1, H2, ..., H13, 
C1, C2, ..., C13, 
D1, D2, ..., D13, 
J1, J2
 

where "S" stands for "Spade", "H" for "Heart", "C" for "Club", "D" for "Diamond", a

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值