题解 | #汽水瓶#
汽水瓶
https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
while True:
s=int(input())
if s==0:
break
remnant=s
bottles=0
while True:
if remnant==2:
bottles+=1
break
if remnant==1:
break
bottle=remnant//3
bottles+=bottle
remnant=remnant%3+bottle
print(bottles)

查看22道真题和解析