题解 | 最少纸币兑换数

最少纸币兑换数

https://www.nowcoder.com/practice/8270c12843224a3aada8f3cc9302c577

n = int(input())
nums = [100, 50, 20, 10, 5, 1]
ans = 0
for x in nums:
    ans += n // x
    n %= x
print(ans)

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务