BOJ/백준-11721-python

cosmos·2022년 2월 24일
0
post-thumbnail

문제

풀이

  • 반복문과 슬라이싱을 이용하여 구현하였다.

코드

# https://www.acmicpc.net/problem/11721
# boj, 11721: 열 개씩 끊어 출력하기, python3
import sys

input = sys.stdin.readline

def solve(word):
    tmp = 0
    for x in range(0, len(word), 10):
        print(word[tmp:x+10])
        tmp = x+10

if __name__ == '__main__':
    word = str(input())

    solve(word)

결과

출처 & 깃허브

BOJ 11721
gihub

0개의 댓글