python版
2025-03-29 11:06:11
发布于:上海
1阅读
0回复
0点赞
a=input()
answer=a.split(" ")
a1=int(answer[0])
b1=answer[1]
price=0
if b1 == "y":
price+=5
if a1<=1000:
price+=8
print(price)
if a1>1000:
price+=8
a1-=1000
price+=a1//500*4
if a1 % 500 > 0:
price+=4
print(price)
else:
print(price)
if b1 == "n":
if a1<=1000:
price+=8
print(price)
if a1>1000:
price+=8
a1-=1000
price+=a1//500*4
if a1 % 500 > 0:
price+=4
print(price)
else:
print(price)
这里空空如也
有帮助,赞一个