UVa 12250 – Language Detection

Problem link


<Source Code>

#include<stdio.h>
#include<string.h>
int main()
{
char c[10000];int i=0;
while(gets(c)){
if(c[0]==’#’)
break;
else{i++;
if(strcmp(c,”HELLO”)==0)
printf(“Case %d: ENGLISH\n”,i);
else if(strcmp(c,”HOLA”)==0)
printf(“Case %d: SPANISH\n”,i);
else if(strcmp(c,”HALLO”)==0)
printf(“Case %d: GERMAN\n”,i);
else if(strcmp(c,”BONJOUR”)==0)
printf(“Case %d: FRENCH\n”,i);
else if(strcmp(c,”CIAO”)==0)
printf(“Case %d: ITALIAN\n”,i);

else if(strcmp(c,”ZDRAVSTVUJTE”)==0)
printf(“Case %d: RUSSIAN\n”,i);
else
printf(“Case %d: UNKNOWN\n”,i);
}
}
return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s