#32258: python


dutom888@gmail.com (Tom Du)


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
#32358: Re: python


054656-105138@stu.mlc.edu.tw (謝帛叡)


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)是甚麼意思

#32359: Re: python


dutom888@gmail.com (Tom Du)


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小