Skip to content

Instantly share code, notes, and snippets.

@Kernelzero
Created June 2, 2021 07:17
Show Gist options
  • Save Kernelzero/018c7652121643e404ea51bc88001b68 to your computer and use it in GitHub Desktop.
Save Kernelzero/018c7652121643e404ea51bc88001b68 to your computer and use it in GitHub Desktop.
currency =[10,50,100,500,1000,5000,10000,50000]
exchange = int(input())
count = 0
currency.reverse()
while exchange != 0:
for n in currency:
if exchange >= n :
tempCount = exchange//n
subtract = tempCount * n
exchange -= subtract
count += tempCount
print(count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment