UVA 12250 - Language Detection UVA • Sep 1, 2020 Problem PDFSolution:/*# include # include int main() { char a[20]; int i; for(i=1;scanf("%s",a);i++) { if(a[0]=='#' && a[1]=='\0') return 0; if(strcmp(a,"HELLO")==0) printf("Case %d: ENGLISH\n",i); else if(strcmp(a,"HOLA")==0) printf("Case %d: SPANISH\n",i); else if(strcmp(a,"HALLO")==0) printf("Case %d: GERMAN\n",i); else if(strcmp(a,"BONJOUR")==0) printf("Case %d: FRENCH\n",i); else if(strcmp(a,"CIAO")==0) printf("Case %d: ITALIAN\n",i); else if(strcmp(a,"ZDRAVSTVUJTE")==0) printf("Case %d: RUSSIAN\n",i); else printf("Case %d: UNKNOWN\n",i); } return 0; }*/ # include # include int main() { char a[20]; int i; for(i = 1 ; ; i++) { while(scanf ("%s",&a)==1) { if(a[0]=='#' && a[1]=='\0') return 0; if(strcmp(a,"HELLO")==0) printf("Case %d: ENGLISH\n",i); else if(strcmp(a,"HOLA")==0) printf("Case %d: SPANISH\n",i); else if(strcmp(a,"HALLO")==0) printf("Case %d: GERMAN\n",i); else if(strcmp(a,"BONJOUR")==0) printf("Case %d: FRENCH\n",i); else if(strcmp(a,"CIAO")==0) printf("Case %d: ITALIAN\n",i); else if(strcmp(a,"ZDRAVSTVUJTE")==0) printf("Case %d: RUSSIAN\n",i); else printf("Case %d: UNKNOWN\n",i); break; } } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12250/12250.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read