a089: Language Detection 語言檢測
標籤 :
通過比率 : 100% (2 人 / 2 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2021-04-12 11:14

內容

English, Spanish, German, French, Italian and Russian are the six most prominent languages in the countries of the European Union. All of these languages have different words to represent the English word “HELLO.” For example, the word equivalent to “HELLO” is “HOLA” in Spanish.  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 identify what language it is.

 

英文、西班牙文、德文、法文、義大利文及俄文為歐盟國家中最盛行的 6 種語言。左圖顯示英語人口在歐洲各國的密度。這些語言都有不同的字來表示英文的「HELLO」。例如西班牙文中等同於英文「HELLO」的字是「HOLA」,而德文、法文、義大利文及俄文中意思為(或相近)「HELLO」的字依序為「HALLO」、「BONJOUR」、「CIAO」和「ZDRAVSTVUJTE」。

你在本題中的任務非常簡單。給你以上的幾個單字之一或是其他的單字,你需要辨識它是哪一種語言。

輸入說明

The input contains around 2000 lines. Each line contains a string. You can assume that all the letters of the string are uppercase English letters, and the maximum length of the string is 14. Input is terminated by a line containing a single  character #. This line needs not to be processed.

輸入含有大約 2000 行。每行含有一個字串 。你可以假設所有的字母都是大寫英文字母,且字串的最大長度為 14。輸入以僅含有一個 # 的一行作為結束,該行不需處理。

 

輸出說明

Each line of input, except the last one, produces one output line. Each output 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 report the language it belongs to. If the input string is something other than these six strings, print the string ‘UNKNOWN’ (without the quotes) instead. All characters in the output strings are uppercase as well.  Samples are shown below.

除了最後一行以外,每一行輸入都要產生一行輸出。 每個輸出行含有輸出的序號及語言名稱。如果輸入的字串是「HELLO」、「HOLA」、「HALLO」、「BONJOUR」、「CIAO」或「ZDRAVSTVUJTE」時,你要回報它是屬於哪一種語言。如果輸入字串是這 6 個以外的字串,則印出字串「UNKNOWN」。所有的輸出字串也都是大寫。詳細的格式細節請參見範例。

範例輸入
HELLO
HOLA
HALLO
BONJOUR
CIAO
ZDRAVSTVUJTE
ALOHA
#
範例輸出
Case 1: ENGLISH
Case 2: SPANISH
Case 3: GERMAN
Case 4: FRENCH
Case 5: ITALIAN
Case 6: RUSSIAN
Case 7: UNKNOWN
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (50%): 1.0s , <1K
隱藏 測資點#1 (50%): 1.0s , <1K
提示 :
標籤:
出處:
https://zerojudge.tw/ShowProblem?problemid=a135 [編輯 :
zero_jason (zero_jason(MANAGER))
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」