Codeforces A. Way Too Long Words with C#
using System;
using System.Xml;
class WayTooLongWords{
public static void Main(string[] args){
int n = int.Parse(Console.ReadLine());
while (n > 0)
{
string word = Console.ReadLine();
int wordLength = word.Length;
string output = "";
if (wordLength > 10)
{
int middleWord = wordLength - 2;
output = output + word[0] + middleWord.ToString() + word[wordLength-1];
Console.WriteLine(output);
}
else
{
Console.WriteLine(word);
}
n--;
}
}
}
No comments