Advertisement
nq1s788

23 без ограничений (вперед)

Jan 13th, 2024
1,551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. a = [0] * 10
  2. a[2] = 1
  3. for i in range(2, 10):
  4.     if i + 1 <= 9:
  5.         a[i + 1] += a[i]
  6.     if i + 2 <= 9:
  7.         a[i + 2] += a[i]
  8.     if i + i - 1 <= 9:
  9.         a[i + i - 1] += a[i]
  10. print(a[9])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement