好的!
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void paixu(int a[])
{
int i,j,t;
for(j=1;j<13;j++)
for(i=0;i<13-j;i++)
if(a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;}
}
void p(int b[],char n[])
{
int i;
char c=3,d=4,e=5,f=6;
for(i=0;i<13;i++)
if(b[i]/13==0) {printf("%3c",f);printf("%c",n[b[i]%13]);}
for(i=0;i<13;i++)
if(b[i]/13==1) {printf("%3c",c);printf("%c",n[b[i]%13]);}
for(i=0;i<13;i++)
if(b[i]/13==2) {printf("%3c",e);printf("%c",n[b[i]%13]);}
for(i=0;i<13;i++)
if(b[i]/13==3) {printf("%3c",d);printf("%c",n[b[i]%13]);}
printf("\n");
}
int main()
{
int a[52],b1[13],b2[13],b3[13],b4[13];
int b11=0,b22=0,b33=0,b44=0,t=1,m,f=1,i;
static char n[]={'2','3','4','5','6','7','8','9','T','J','Q','K','A'};
srand(time(NULL));
while(t<=52)
{
m=a[52];
for(f=1,i=0;i<t;i++)
if(m==a[i]) f=0;
if(f)
{
a[t++]=m;
if(t%4==0) b1[b11++]=a[t-1];
else if(t%4==1) b2[b22++]=a[t-1];
else if(t%4==2) b3[b33++]=a[t-1];
else if(t%4==3) b4[b44++]=a[t-1];
}
}
paixu(b1);paixu(b2);paixu(b3);paixu(b4);
p(b1,n);p(b2,n);p(b3,n);p(b4,n);
}
各位帮忙看看这个!