백준 21966번: (중략) #Python

ColorlessDia·2024년 8월 1일

algorithm/baekjoon

목록 보기
256/807
N = int(input())
S = input()

if len(S) <= 25:
    print(S)
else:
    word = S[11:-11]

    if '.' in word:
        
        if '.' in word[:-1]:
            print(S[:9] + '......' + S[-10:])
        else:
            print(S[:11] + '...' + S[-11:])
    else:
        print(S[:11] + '...' + S[-11:])

0개의 댓글