某商店规定:三个空汽水瓶可以换一瓶汽水。小张手上有十个空汽水瓶,她最多可以换多少瓶汽水喝?”
因为三个空汽水瓶可以换一瓶汽水,即三个空汽水瓶=一个空汽水瓶和汽水本身
所以汽水本身=2个空汽水瓶
def drink():
while True:
try:
num = int(input())
if num != 0:
print(num//2) # 整除2
except:
break
if __name__ == "__main__":
drink()
10块钱买汽水问题,1块钱1瓶,2个空瓶换1个汽水,4个瓶盖换1个汽水,10块钱能买多少瓶汽水。
1.while循环
def buy_water_up(get,money,empty,cap):
if money>