while True:
try:
N = int(input())
ans = N
while N >= 3:
ans += N // 3
N = N // 3 + N % 3
ans += (N == 2)
print(ans)
except:
break
請問ans += (N == 2)是甚麼意思
while True:
try:
N = int(input())
ans = N
while N >= 3:
ans += N // 3
N = N // 3 + N % 3
ans += (N == 2)
print(ans)
except:
break
請問ans += (N == 2)是甚麼意思3小