BOJ - 1284 - 집 주소

Updated:

import sys

def solution():
    space = (4, 2, 3, 3, 3, 3, 3, 3, 3, 3)
    while True:
        N = int(input())
        if not N:
            break

        data = str(N)
        cnt = len(data) + 1
        for i in range(len(data)):
            cnt += space[int(data[i])]
        print(cnt)

solution()

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

Categories:

Updated:

Leave a comment