题解 | #汽水瓶#python3递归
汽水瓶
http://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
total = 0
def fun(num):
global total
if num <2:
print(total)
return 0
elif num ==2:
total +=1
print(total)
else:
nn = num // 3
total += nn
left = nn + num % 3
fun(left)
while True:
try:
num = int(input())
total = 0
if num != 0:
fun(num)
except:
break