Code Forces Problem Way Too Long Words

So I am trying to solve problem way too long words from codeforces here 's the link to check it https://codeforces.com/problemset/problem/71/A
now in my code i have created logic for word which have more than 10 characters would become in a special abbrevations and words which are less than 10 characters would be print as it is but i am not able to filter and remove int if user inputs integer with string

here is my code

C#

    internal class Program
    {
        private static void Main(string[] args)
        {
            string name = Console.ReadLine();
            var convert = Convert.ToInt32(name);
            int strlength = name.Length;
            if(strlength > 10)
            {
                char[] split = name.ToCharArray();
                int charCount = strlength - 2;
                int lastChar = split.Length - 1;
                Console.WriteLine("{0}{1}{2}", split[0], charCount, name[lastChar]);
            }
        
            else
        {
            Console.WriteLine(name);
        }
        }
    }
Was this page helpful?