Click Here to see the problem detail.

Solution

Read the problem carefully & see source code.

Source Code
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
 
void removeSpace(char *str)
{
    int i,j;
    j=0;
    char a[20];
    for(i=0; i<strlen(str); i++)
    {
        while(str[i]==' ')
            i++;
        a[j]=str[i];
        j++;
    }
    a[j]='\0';
    strcpy(str,a);
}
 
int main()
{
    char testCase[10];
    char team[25],judge[25];
 
    int i,j,c;
    gets(testCase);
    int t=atoi(testCase);
    c=1;
    while(t--)
    {
 
        gets(team);
        gets(judge);
        if(strcmp(team,judge)==0)
        {
            printf("Case %d: Yes\n",c);
        }
        else
        {
            removeSpace(team);
            removeSpace(judge);
            if(strcmp(team,judge)==0)
            {
                printf("Case %d: Output Format Error\n",c);
            }
            else
            {
                printf("Case %d: Wrong Answer\n",c);
            }
        }
 
        c++;
 
    }
 
    return 0;
}

 


Next Previous