Write a program to find the minimum number of notes required for the amount
The first line is a single integer
Given
M = 1543, it can be written as1543 = 3*(500) + 3*(50) + 0*(10) + 1*(3)Then the output should be
500: 3 50: 0 10: 4 1: 3
nums = (500, 50, 10,1)
M = int(input("Enter amount: "))
output = {}
for i in nums:
output[i] = M//i
M %= i
for k, val in output.items():
print(k, val, sep=':')
Comments
Leave a comment