用户:
徐杭晨查看:0 回复:0 评论:0 创建时间:2021-11-17T18:40:11
【作品展示】

【作品介绍】
可以买东西
【作品源代码】
s = int(input('输入应付多少:'))
a = 1
b = 5
c = 10
d = 20
e = 50
pay = 0
while (pay < s):
y = int(input('收钱:'))
pay += y
print('实际收款', pay)
# 找零的钱
f = (pay - s)
while (s > 0):
if (f >= e):
print(e)
f -= e
if (f >= d):
print(d)
f -= d
if (f >= c):
print(c)
f -= c
if (f >= b):
print(b)
f -= b
if (f >= a):
print(a)
f -= a
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn