题解 | #汽水瓶#
汽水瓶
https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
import sys for line in sys.stdin: a = int(line) if a == 0: break count = 0 while a >= 3: count += a//3 a = a // 3 + a % 3 if a == 2: count += 1 print(count)
汽水瓶
https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
import sys for line in sys.stdin: a = int(line) if a == 0: break count = 0 while a >= 3: count += a//3 a = a // 3 + a % 3 if a == 2: count += 1 print(count)
相关推荐