n,m = map(int, input().split())
mode = 0
for i in range(n):
x = input()
# 모드 설정
if x == '<CENTER>':
mode = 1
continue
elif x == '<RIGHT>':
mode = 2
continue
if x == '</CENTER>' or x == '</RIGHT>':
mode = 0
continue
# 모드에 따라서 글자 넣기
if mode == 0:
z = x
sen = z.split()
j = 0
sum = 0
while True:
if sum + len(z[j]) > m:
j += 1
top of page

실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
20240523
20240523
댓글 0개
좋아요
댓글(0)
bottom of page