BOJ - 2033 - 반올림

Updated:

def solution():
    N = int(input())
    div = 10
    while N > div:
        if N % div >= div // 2:
            N += div
        N -= (N % div)
        div *= 10
    print(N)

solution()

https://www.acmicpc.net/problem/2033

Categories:

Updated:

Leave a comment