UVa 12250 Language Detection (water ver.)

Source: Internet
Author: User
Tags cas time limit

12250-language detection

Time limit:3.000 seconds

Http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem &problem=3402

中文版, Spanish, German, French, Italian and Russian are the 6 most prominent languages in the countries of European N. Figure on the left shows intensity of 中文版 speaking people in different European countries. All of this languages have different words to represent the 中文版 word "HELLO". For example in Spanish the word equivalent to "HELLO" is "HOLA". In German, French, Italian and Russian language the word that means (or similar to) "HELLO" is "Hallo", "BONJOUR", "CIAO" and "Zdravstvujte" respectively.

In this problem your the task is pretty simple. You are given one of the six words mentioned above or any other word and your would have to try and detect the language It is from.

Input

Input file contains around lines of inputs. Each line contains a StringS. You can assume this all the letters of the string are uppercase Chinese letters and the maximum length of the string is14. The Input is terminated by a line containing a single ' # ' character (without the quote). This line should is processed.

Output

This article URL address: http://www.bianceng.cn/Programming/sjjg/201410/45520.htm

For each line of input except the last one produce one line of output.

This line contains the serial of output followed by a language name. If the input string is ' HELLO ' or ' HOLA ' or ' hallo ' or ' BONJOUR ' or ' CIAO ' or ' zdravstvujte ' then you should the Lang Uage it belongs to. If the input string is something other than these 6 strings print the string "UNKNOWN" (without the quotes) instead. All characters in the output strings are uppercase as. Look in the output for sample input for formatting details.

HELLO
HOLA
Hallo
BONJOUR
CIAO
Zdravstvujte
#
Case 1:english
Case 2:spanish
Case 3:german
Case 4:french
Case 5:italian
Case 6:russian
/*0.009s*/
    
#include <cstdio>  
#include <cstring>  
const char* Hello[6] = {"Hello", "HOLA", " Hallo "," BONJOUR "," CIAO "," Zdravstvujte "};  
Const char* Country[7] = {"中文版", "Spanish", "GERMAN", "FRENCH", "Italian", "Russian", "UNKNOWN"};  
    
Char str[20];  
    
int main ()  
{  
    int cas = 0, I;  
    while (gets (str), str[0]!= ' # ')  
    {  
        printf ("Case%d:", ++cas);  
        for (i = 0; i < 6; ++i)  
            if (strcmp (str, hello[i]) = = 0)  
            {  
                puts (country[i));  
                break;  
        if (i = = 6) puts (Country[i]);  
    }  
    return 0;  
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.