题解 | #汽水瓶#
汽水瓶
https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
import sys def f(n): if n <= 1: return 0 if n == 2: return 1 return n//3 + f(n//3 + n%3) for line in sys.stdin: num = int(line) # 输入的 0 表示输入结束 if num == 0: break print(f(num))