JLOG

[Python] 코드업 3301 : 거스름돈 풀이 본문

Algorithm/알고리즘 풀이

[Python] 코드업 3301 : 거스름돈 풀이

정정선선 2020. 5. 10. 14:57

https://codeup.kr/problem.php?id=3301

 

# Code up 3301 : 거스름돈
# https://codeup.kr/problem.php?id=3301

change = int(input())

num = 0
money = [50000, 10000, 5000, 1000, 500, 100, 50, 10]

for m in money : #[
    num += change//m
    change = change%m
#]

print(num)

 

Comments