# -*- 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))
标签:--,money,找零,算法,change,贪心
From: https://www.cnblogs.com/zylyehuo/p/17641668.html