mirror of
https://github.com/Fare-spec/cours.git
synced 2025-12-09 19:30:40 +00:00
formatte file
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
import numpy as np
|
||||
|
||||
|
||||
def fibobo(n):
|
||||
if n<= 1:
|
||||
if n <= 1:
|
||||
return n
|
||||
return fibobo(n-1) + fibobo(n-2)
|
||||
return fibobo(n - 1) + fibobo(n - 2)
|
||||
|
||||
|
||||
print(fibobo(30))
|
||||
|
||||
|
||||
def fibibi(n):
|
||||
fibi = np.array([[1,1],[1,0]])
|
||||
return np.linalg.matrix_power(fibi,n)[0][-1]
|
||||
fibi = np.array([[1, 1], [1, 0]])
|
||||
return np.linalg.matrix_power(fibi, n)[0][-1]
|
||||
|
||||
|
||||
print(fibibi(100))
|
||||
|
||||
Reference in New Issue
Block a user