[求助]洗牌函数
设用两维函数deck[52][2]表示一副扑克牌,数组的一行用于存储一张牌的花色和面值。另外引入以下字符指针数组用于存储牌的花色名称:char *suit[4]={"Spades","Hearts","Diamonds","Clude"};
char *face[13]={"Ace","Deduce","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Qween","King"};
试按以下要求编写洗牌模拟函数。令52张牌按顺序排序于0~51对应。首先顺序地将花色和面值天如数组deck中,然后逐一考察这52张牌,并为每一张牌随机产生一个0~51的一个数字。并将当前正在考察的牌于随机产生的整数对应的牌对换。直至每张牌都被考察后停止洗牌。
怎么样控制随机数的范围呢?