题解 | #汽水瓶#
https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
正常思路:
def swape(n, add=0):
while 1:
if n == 2:
add += 1
return add
if n < 2:
return add
water = 0
water = n // 3
add += n // 3
n = water + n % 3
while 1:
n = int(input())
if n == 0:
break
print(swape(n))
while 1:
if n == 2:
add += 1
return add
if n < 2:
return add
water = 0
water = n // 3
add += n // 3
n = water + n % 3
while 1:
n = int(input())
if n == 0:
break
print(swape(n))