贪心算法--找零问题
# -*- coding: utf-8 -*-
t = [100, 50, 20, 5]
def change(t, n):
m = [0 for _ in range(len(t))] # m 为各面额纸币的张数
for i, money in enumerate(t):
m[i] = n // money
n = n % money # n 为找零金额
return m, n
print(change(t, 376))