Need help. Way Too Long Words

Revision en1, by basecamper, 2020-10-20 17:50:21

Hello,

I am trying to solve A. Way Too Long Words in C# (I already have a solution in c++). https://codeforces.com/problemset/problem/71/A

The code below gives correct answers when I try and compile it on my own. However, when submitting it for verdict through the Codeforces system, turns out as the Wrong answer. If you have an idea of how to change the code to get a successful submission, please help.

Thank you

basecamper

using System;

namespace Way_Too_Long_Words { class Program { static void Main(string[] args) { int n; n = int.Parse(Console.ReadLine());

int i = 1;

        while (i <= n)
        {
            string inputName = Console.ReadLine();

            if (inputName.Length > 10)
            {
                Console.Write(inputName[0]); Console.Write(inputName.Length - 2); Console.Write(inputName[inputName.Length - 1]);
                Console.Read();
            }
            else
            {
                Console.WriteLine(inputName);
                Console.Read();
            }

            i++;
        }
    }
}

}

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English basecamper 2020-10-20 18:56:43 4
en3 English basecamper 2020-10-20 18:56:03 8
en2 English basecamper 2020-10-20 18:55:08 558
en1 English basecamper 2020-10-20 17:50:21 1290 Initial revision (published)