mirror of
https://github.com/iritmaximus/tira.git
synced 2026-10-12 19:13:47 +03:00
16 lines
227 B
Python
16 lines
227 B
Python
def f(n):
|
|
global count
|
|
count += 1
|
|
if n <= 2:
|
|
return n
|
|
return f(n - 1) + f(n - 2) + f(n - 3)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
count = 0
|
|
f(10)
|
|
print(count)
|
|
count = 0
|
|
f(30)
|
|
print(count)
|