Forezz

ДЗ 13 Н 1

Aug 11th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. n = int(input())
  2. a = [None] * (n + 1)
  3. a[2] = 1
  4. a[3] = 2
  5. for i in range (4, n + 1):
  6.     a[i] = a[i - 1] + a[i - 2]
  7. print(a[n])
Advertisement
Add Comment
Please, Sign In to add comment