본문 바로가기

Programming/Algorithm

[Python] 백준 2747번 : 피보나치 수


n = int(input())

a, b = 0, 1
while n > 0:
    a, b = b, a + b
    n -= 1
    
print(a)