a773: Way Too Long Words ( 太長的單詞 )
Tags : 800 strings
Accepted rate : 53人/55人 ( 96% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-07-17 21:11

Content

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”。

建議您使用縮寫詞自動更改單詞的過程。 太長的詞都應該用縮寫代替,不太長的詞不應該有任何變化。

Input

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 個字符。

Output

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 個單詞的結果。

Sample Input #1
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
Sample Output #1
word
l10n
i18n
p43s
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (5%): 0.5s , <1M
公開 測資點#1 (5%): 0.5s , <1M
公開 測資點#2 (5%): 0.5s , <1M
公開 測資點#3 (5%): 0.5s , <1M
公開 測資點#4 (5%): 0.5s , <1M
公開 測資點#5 (5%): 0.5s , <1M
公開 測資點#6 (5%): 0.5s , <1M
公開 測資點#7 (5%): 0.5s , <1M
公開 測資點#8 (5%): 0.5s , <1M
公開 測資點#9 (5%): 0.5s , <1M
公開 測資點#10 (5%): 0.5s , <1M
公開 測資點#11 (5%): 0.5s , <1M
公開 測資點#12 (5%): 0.5s , <1M
公開 測資點#13 (5%): 0.5s , <1M
公開 測資點#14 (5%): 0.5s , <1K
公開 測資點#15 (5%): 0.5s , <1K
公開 測資點#16 (5%): 0.5s , <1K
公開 測資點#17 (5%): 0.5s , <1K
公開 測資點#18 (5%): 0.5s , <1K
公開 測資點#19 (5%): 0.5s , <1K
Hint :
Tags:
800 strings
出處:
Codeforces Beta Round #65 [管理者:
lamkinun@gma... (Kinda Lam)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」