一副扑克有52张牌,打牌时将牌发给4个人,现设计一个程序完成自动发牌的工作。
要求:黑桃用 S 表示;红桃用 H 表示;方块用 D 表示;梅花用 C 表示。
程序如下
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void p(int *, char *);
int comp(const void *j, const void *i);
int main()
{
static char n[] = {
'2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A'};
int a[53], b1[13], b2[13], b3[13], b4[13];
int b11 = 0, b22 =