Skip to content

Commit

Permalink
Create ex3-1.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jisunp04023 authored Sep 2, 2023
1 parent 508f6cc commit ed59d30
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ex3-1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 예제 3-1
"""
거스름돈 500원, 100원, 50원, 10원 무한히 존재
손님에게 거슬러 줘야 할 돈이 N원일 때, 거슬러 줘야 할 동전의 최소 개수를 구하라.
N은 항상 10의 배수
"""
n = int(input())

coin = [500, 100, 50, 10]
count = 0

for i in coin:
count += (n // i)
n = n % i

print(count)

0 comments on commit ed59d30

Please sign in to comment.