题解 | 公司发工资问题

公司发工资问题

https://www.nowcoder.com/practice/b0032ab1a71f4b15b39c2e024660e4de

money1=[0 for i in range(6)]
s=[100,50,20,10,5,1]
text=[]
while True:
    a=int(input())
    if a==0:
        break
    for i in range(6):
        money1[i]+=(a//s[i])
        a=a%s[i]
for i in range(6):
    text.append(str(s[i])+':'+str(money1[i]))
print(*text,sep=',')

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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