去年面谷歌的时候还被问过这道题。最后还是悲剧了,好伤心:sob:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _71A
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
while (n-- != 0)
{
string word = Console.ReadLine();
if (word.Length <= 10)
{
Console.WriteLine(word);
}
else
{
string abbr = word[0].ToString() + (word.Length - 2).ToString() + word[word.Length - 1].ToString();
Console.WriteLine(abbr);
}
}
}
}
}