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