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
4 weeks ago
|
#Datei: fib.py
|
||
1 month ago
|
|
||
4 weeks ago
|
import functools
|
||
1 month ago
|
import sys
|
||
4 weeks ago
|
from counter import counter
|
||
1 month ago
|
|
||
4 weeks 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)
|
||
|
|
||
|
|
||
|
|