You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
180 B
17 lines
180 B
1 month ago
|
#Datei: fib.py
|
||
1 month ago
|
|
||
1 month ago
|
import functools
|
||
1 month ago
|
import sys
|
||
1 month ago
|
from counter import counter
|
||
1 month ago
|
|
||
1 month ago
|
#@functools.cache
|
||
|
@counter
|
||
1 month ago
|
def fib(n):
|
||
|
if n in [0,1]:
|
||
|
return n
|
||
|
else:
|
||
|
return fib(n-1) + fib(n-2)
|
||
|
|
||
|
|
||
|
|