XJTU_Python/test/3/3.py

5 lines
109 B
Python

n = int(input())
a = [0, 1]
for i in range(2, n + 1):
a.append(a[i - 1] + a[i - 2]) # 递推
print(a[n])