Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.
Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.
This abbreviation is made like this: we write down the first and the last letter of a word and between them we write the number of letters between the first and the last letters. That number is in decimal system and doesn't contain any leading zeroes.
Thus, "localization" will be spelt as "l10n", and "internationalization» will be spelt as "i18n".
You are suggested to automatize the process of changing the words with abbreviations. At that all too long words should be replaced by the abbreviation and the words that are not too long should not undergo any changes.
有時像“localization”或“internationalization”這樣的詞太長了,以至於在一篇文章中多次寫它們是很累的。
讓我們考慮一個詞太長,如果它的長度嚴格超過 10 個字符。 所有太長的詞都應該用特殊的縮寫代替。
這個縮寫是這樣寫的:我們寫下一個單詞的第一個和最後一個字母,在它們之間我們寫下第一個和最後一個字母之間的字母數。 該數字採用十進制系統,不包含任何前導零。
因此,“localization”將拼寫為“l10n”,“internationalization» 將拼寫為“i18n”。
建議您使用縮寫詞自動更改單詞的過程。 太長的詞都應該用縮寫代替,不太長的詞不應該有任何變化。
The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters.
第一行包含一個整數 n (1 ≤ n ≤ 100)。 以下 n 行中的每一行都包含一個單詞。 所有單詞均由小寫拉丁字母組成,長度為 1 到 100 個字符。
Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data.
打印 n 行。 第 i 行應包含從輸入數據中替換第 i 個單詞的結果。
4 word localization internationalization pneumonoultramicroscopicsilicovolcanoconiosis
word l10n i18n p43s
ID | User | Problem | Subject | Hit | Post Date |
沒有發現任何「解題報告」 |