Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么一直WA呢,高手提示下

Posted by z554243955 at 2011-08-10 11:06:29 on Problem 2062
#include<stdio.h>
#include<string.h>
void main()
{
    int a;
    int num,i,j,x,y,z,same,sum;
    char b[300][2];
    char c[300][2];
    char d[900][2];
    scanf("%d",&a);
    for(i=0; i<a; i++)
    {
        same=0;
        sum=0;
        z=0;
        scanf("%d",&num);
        for(j=0; j<num; j++)
        {
            scanf("%s",b[j]);
            if(b[j][1]=='S')b[j][1]='E';
            if(b[j][0]=='T')b[j][0]='F';
            if(b[j][0]=='J')b[j][0]='G';
            if(b[j][0]=='Q')b[j][0]='I';
            if(b[j][0]=='A')b[j][0]='L';
        }
        for(j=0; j<num; j++)
        {
            scanf("%s",c[j]);
            if(c[j][1]=='S')c[j][1]='E';
            if(c[j][0]=='T')c[j][0]='F';
            if(c[j][0]=='J')c[j][0]='G';
            if(c[j][0]=='Q')c[j][0]='I';
            if(c[j][0]=='A')c[j][0]='L';
        }
        for(x=0; x<num; x++)
            for(y=0; y<num; y++)
                if(strcmp(c[y],b[x])==1)
                {
                    
                    sum++;
                    strcpy(d[z++],c[y]);
                }
       
        for(x=0; x<z; x++)
            for(y=x+1; y<z; y++)
                if(d[y][0]==d[x][0]&&d[y][1]==d[x][1]&&d[y][0]!='0')
                    {same++;d[y][0]='0';}
               printf("%d\n",sum-same);




    }
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator