酷代码 AI
菜单
服务商

Python 实现:根据金额计算各面额人民币张数,优先用大面额

```python amount = int(input()) # 计算各面额张数 hundreds = amount // 100 amount %= 100 fifties = amount // 50 amount %= 50 twenties = amount // 20 amount %= 20 tens = amount // 10 amount %= 10 fives = amount // 5 amount %= 5 ones = amount # 输出结果 print(hundreds) print(fifties) print(twenties) print(tens) print(fives) print(ones) ``` ######[AI问答 | 140点数解答 | 2026-01-27 17:07:31]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]