728x90
반응형

문제 주소: codeforces.com/problemset/problem/71/A

간단한 문자열 관련 문제이다. len을 사용해서 풀었다.

for _ in range(int(input())):
    s = input()
    if len(s) > 10:
        print(s[0], len(s)-2, s[-1], sep='')
    else:
        print(s)
for _ in range(int(input())):
    s = input()
    print(s[0]+str(len(s)-2)+s[-1] if len(s) > 10 else s)
728x90
반응형

'Agorithm > Codeforces' 카테고리의 다른 글

50A-Domino piling  (0) 2021.02.16
158A-Next Round  (0) 2021.02.16
231A-Team  (0) 2021.02.16
1A-Theatre Square  (0) 2021.02.16
4A-Watermelon  (0) 2021.02.16

+ Recent posts