Why WA for the problem 12250

All about problems in Volume CXXII. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Why WA for the problem 12250

Postby esharif » Tue Jun 19, 2012 10:33 pm

Code: Select all
 :oops:
#include<stdio.h>
#include<string.h>
#define max 16
int main()
{
   int  i=0;
   char str[max];
   while(scanf("%s",&str)==1 && strcmp(str,"#")!=0)
   {
      if(strcmp(str,"HELLO")==0)
         printf("Case %d: ENGLISH\n",++i);
      else if(strcmp(str,"HOLA")==0)
         printf("Case %d: SPANISH\n",++i);
      else if(strcmp(str,"HALLO")==0)
         printf("Case %d: GERMAN\n",++i);
      else if(strcmp(str,"BONJOUR")==0)
         printf("Case %d: FRENCH\n",++i);
      else if(strcmp(str,"CIAO")==0)
         printf("Case %d: ITALIAN\n",++i);
      else if(strcmp(str,"ZDRAVSTVUJTE")==0)
         printf("Case %d: RUSSIAN\n",++i);
      else
         printf("UNKNOWN\n");
   }
return 0;
}
esharif
New poster
 
Posts: 18
Joined: Sun Jun 03, 2012 11:56 pm

Re: Why WA for the problem 12250

Postby brianfry713 » Tue Jun 19, 2012 11:35 pm

Print the case number if the language is UNKNOWN.
brianfry713
Guru
 
Posts: 1742
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Why WA for the problem 12250

Postby esharif » Wed Jun 20, 2012 3:49 pm

Thnx a lot. I've got AC finally, though the problem was submitted :lol: 23 times.
esharif
New poster
 
Posts: 18
Joined: Sun Jun 03, 2012 11:56 pm


Return to Volume CXXII

Who is online

Users browsing this forum: No registered users and 1 guest