[SWEA] 1970 쉬운 거스름돈

김은서·2021년 9월 15일
0

SWEA

목록 보기
32/47

Python Code

T = int(input())
for tc in range(1, T+1):
    N = int(input())
    lst = []
    money = [50000, 10000, 5000, 1000, 500, 100, 50, 10]
    for i in money:
        if N >= i:
            lst.append(N // i)
            N = N - N // i * i
        else:
            lst.append(0)
    print('#{} '.format(tc), end='')
    for i in lst:
        print(i, end=' ')
    print()
    
profile
Gracelog

0개의 댓글