解题思路:
注意事项:
参考代码:while True:
n = list(map(int,input().split()))
if n[0] == 0:
exit(0) #退出程序
if n[0] < 100:
def salary(g):
count = 0
while g >= 100:
g = g - 100
count += 1
while 50 <= g < 100:
g = g - 50
count += 1
while 10 <= g < 50:
g = g - 10
count += 1
while 5 <= g < 10:
g = g - 5
count += 1
while 2 <= g < 5:
g = g - 2
count += 1
while g == 1:
g = g - 1
count += 1
if g == 0:
return count
if n[0] == (len(n) - 1):
sum = 0
for i in n[1:]: #循环从列表第二个元素开始遍历
x = salary(i)
sum += x
print(sum)
0.0分
0 人评分
点我有惊喜!你懂得!浏览:1439 |
C二级辅导-分段函数 (C语言代码)浏览:583 |
简单的a+b (C语言代码)浏览:783 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)for循环浏览:1178 |
分糖果 (C++代码)浏览:1537 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:737 |
Pascal三角 (C语言代码)浏览:1252 |
WU-printf基础练习2 (C++代码)浏览:2061 |
DNA (C语言代码)浏览:798 |
模拟计算器 (C语言代码)浏览:2366 |