Commit 1d6bf531 by BellCodeEditor

save project

parent 9d260a2b
Showing with 7 additions and 2 deletions
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
dict= {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6} dict= {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
b=0 b=0
while True: while True:
f=input("是否结算")
j=input("你要买什么?") j=input("你要买什么?")
x=input("个数") x=input("个数")
f=input("是否结算")
if not f=="是": if not f=="是":
if j in dict: if j in dict:
print('您的',j,"需要",dict[j]*int(x),"元,请投币") print('您的',j,"需要",dict[j]*int(x),"元,请投币")
...@@ -12,4 +13,8 @@ while True: ...@@ -12,4 +13,8 @@ while True:
else: else:
print('神奇百货似乎还没有~') print('神奇百货似乎还没有~')
else: else:
print(b) print("请付钱,请付",b)
x=input("钱数")
if int(x)>b:
print("找你",int(x)-b,"元")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment