一名收银员,给顾客找零,找零的目标是给出确定金额的同时,使用尽可能少的硬币。有不同面额的硬币: 1分,5分,10分,25分.如果需要给顾客准确的零钱77分,同时使用最少的硬币下列程序中横线应该填写( )。

jw447097 单选题 共 个子题
def coin_change(amount, coins):
    result = []
    for coin in sorted(coins, reverse=True):
        while amount >= coin:
            ___________________
            result.append(coin)
            return result

            coins = [1, 5, 10, 25]
amount = 63
A

amount -= coin

B

amount <= coin

C

amount >= coin

D

amount += coin

正在加载题目数据…
已答 /
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析
讨论
发布
登录后参与讨论 立即登录
发布讨论需先绑定并验证手机号 去绑定手机号
加载中…
我
我
回复 @
回复 @
发送
还没有人讨论,来发表第一条吧