不要拿去交,输出格式不同,通不过的.
#include<stdio.h>
#include<string.h>
#define M 53
const int a[53]={ 0,  0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,-100,  0,
                    -50,-2,-3,-4,-5,-6,-7,-8,-9,-10,-20, -30,-40,
                      0, 0, 0, 0, 0, 0, 0, 0, 0,  0,100,   0,  0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0,   0,  0};//52牌中各张牌的分数
const char *b="01234567890JQK";   //13种点数 
const int c[4]={6,3,4,5};         //4种花色的ASCII码
const int h_total=-194;           //所有13张红心牌的总分数,用于判断玩家是否拿了所有13张红心
int encode(char *s)               //将扑克牌编号1-52(编码)
{
    int m,p;
    if(*s=='S')
        m=0;
    else if(*s=='H')
        m=1;
    else if(*s=='D')
        m=2;
    else if(*s=='C')
        m=3;
    if(strlen(s)==2)            //输入的字符串只有2个或3个字符两种
    {
        p=*(s+1)+1-'1';
        return m*13+p;
    }
    else
    {
        p=*(s+2)+1-'1'+10*(*(s+1)+1-'1');
        return m*13+p;
    }
}
void decode(int a,char *s)      //s[0]存放花色,s[1]和s[2]存放点数,仅当X10点时才用上s[2]
{
    int t;
    t=(a-1)/13;
    *s=c[t];
    t=(a-1)%13+1;
    if(t==10)
    {
        *(s+1)='1';
        *(s+2)='0';
        *(s+3)='\0';
    }
    else
    {
        *(s+1)=b[t];
        *(s+2)='\0';
    }
}
void count(int (*p)[M],int *s)        //p[][]用于传递4位玩家的牌,s[]用于存储4家的分数
{
    int s_score,h_score,d_score,c_score;
    int i,j,total;
    for(i=0;i<4;i++)
    {
        total=0;
        s_score=0;                      //存放黑桃的分数
        h_score=0;                      //存放红心的分数
        d_score=0;                      //存放方块的分数
        c_score=1;                      //存放梅花的分数
        for(j=1;j<=p[i][0];j++)
        {
            if(p[i][j]>=1  && p[i][j]<=13)
                s_score+=a[p[i][j]];
            else if(p[i][j]>=14 && p[i][j]<=26)
                h_score+=a[p[i][j]];
            else if(p[i][j]>=27 && p[i][j]<=39)
                d_score+=a[p[i][j]];
            else if(p[i][j]==49)
                c_score=2;
        }
        if(h_score==h_total)       //如果玩家拿了所有13张红心
            h_score=200;
        if(h_score==200 && s_score==-100 && d_score==100)
            total=500;            //若 S12、D11 皆在吃下所有红心牌之一家,则此玩家得 +500 分
        else
            total=h_score+s_score+d_score;
        if(total==0 && c_score==2) //若持有 C10 的玩家只有该张牌而没有任何其它牌则得 +50 分
            total=50;
        else
            total*=c_score;       //除了 C10 还有其它计分牌,则将其它计分牌所得分数加倍计算
        s[i]=total;
    }
}
int main(void)
{
    int player[4][M];          //play[i][0]存放玩家i+1牌的张数
    int score[4];
    int i,j;
    char temp[10];             //临时存储输入的字符串
    while(1)
    {
        for(i=0;i<4;i++)
        {
            printf("Player%d:",i+1);
            scanf("%d",&player[i][0]);
            for(j=1;j<=player[i][0];j++)
            {
                scanf("%s",temp);
                player[i][j]=encode(temp);
            }
        }
        if((player[0][0] || player[1][0] || player[2][0] || player[3][0])==0)
            break;
        printf("\n");
        for(i=0;i<4;i++)
        {
            printf("the puker of player%d:",i+1);
            for(j=1;j<=player[i][0];j++)
            {
                decode(player[i][j],temp);
                printf("%4s",temp);
            }
            printf("\n");
        }
        count(player,score);
        printf("\n");
        for(i=0;i<4;i++)
            printf("The score of player%d:%4d\n",i+1,score[i]);
    }
    return 0;
}


 
											






 
	    