Programming contests

Magas szintű programozási nyelvek 1, egyéni verseny, 2014. április 13.

April 13, 2014 10:15 AM – April 13, 2014 3:15 PM

Language Detection

English, Spanish, German, French, Italian, and Russian are the 6 most prominent languages in the countries of the European Union. The figure above shows the intensity of English-speaking people in different European countries. All of these languages have different words to represent the English 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 task is pretty simple. You will be given one of the six words mentioned above or any other word, and you will have to try and detect the language it is from.

Input Specification

The input contains at most 2000 lines. Each line contains a string S. You can assume that all the letters of the string are uppercase English letters and the maximum length of the string is 14. The input is terminated by a line containing a single '#' character (without the quote). This line should not be processed.

Output Specification

For each line of input except the last one, produce one line of output. This line contains the case number followed by a language name. If the input string is “HELLO” or “HOLA” or “HALLO” or “BONJOUR” or “CIAO” or “ZDRAVSTVUJTE”, then you should report the language 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 should be uppercase as well. Look at the output for sample input for formatting details.

Sample Input

  1. HELLO
  2. HOLA
  3. HALLO
  4. BONJOUR
  5. CIAO
  6. ZDRAVSTVUJTE
  7. #
download as text file

Output for Sample Input

  1. Case 1: ENGLISH
  2. Case 2: SPANISH
  3. Case 3: GERMAN
  4. Case 4: FRENCH
  5. Case 5: ITALIAN
  6. Case 6: RUSSIAN
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019