parkershamblin's blog

By parkershamblin, history, 4 years ago, In English

Hi, this is my first day on Codeforces and I'm currently struggling to get started. Here is the link to the problem I am trying to solve: https://codeforces.com/problemset/problem/71/A

I am not sure why my submission keeps failing on test 1.

lines = input()
lines = lines.splitlines()
n = int(lines[0])

for word in lines[1:n+1]:
    if len(word) > 10:
        abrv = f"{word[0]}{len(word[1:-1])}{word[-1]}"
        print(abrv)
    else:
        print(word)

Does anyone have any ideas?

Thanks, Parker.

Full text and comments »

  • Vote: I like it
  • -10
  • Vote: I do not like it