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

12250

Postby Singham_CUET » Sat Jan 28, 2012 12:37 pm

I got time limit...here is my code.can anybody help me to fix it?
Code: Select all
#include<stdio.h>
#include<string.h>
int main()
{
   int i;
   char a[15];
   i=1;
   
   while(1)
   {
      
         gets(a);
         
         if(a[0]=='#'&&a[1]=='\0')
            break;
         else if(strcmp(a,"HELLO")==0)
            printf("Case %d: ENGLISH",i);
         else if(strcmp(a,"HOLA")==0)
            printf("Case %d: SPANISH",i);
         else if(strcmp(a,"HALLO")==0)
            printf("Case %d: GERMAN",i);
         else if(strcmp(a,"BONJOUR")==0)
            printf("Case %d: FRENCH",i);
         else if(strcmp(a,"CIAO")==0)
               printf("Case %d: ITALIAN",i);
         else if(strcmp(a,"ZDRAVSTVUJTE")==0)
               printf("Case %d: RUSSIAN",i);
         else printf("Case %d: UNKNOWN",i);
            i++;
            getchar();
            
   }
   return 0;
}
Singham_CUET
New poster
 
Posts: 1
Joined: Fri Jan 13, 2012 10:42 am

Return to Volume CXXII

Who is online

Users browsing this forum: No registered users and 1 guest