First commit
This commit is contained in:
15
IUT/Info1/TD/Exercices/8.4_fibo/.md
Normal file
15
IUT/Info1/TD/Exercices/8.4_fibo/.md
Normal file
@@ -0,0 +1,15 @@
|
||||
fib : une fonction (a : un entier, b : un entier, n : un entier) -> un entier
|
||||
Lexique :
|
||||
temp : un entier
|
||||
i : un entier
|
||||
Algorithme :
|
||||
Début
|
||||
Tant que i < n
|
||||
temp <- b
|
||||
b <- b + a
|
||||
a <- temp
|
||||
i <- i + 1
|
||||
FinTantQue
|
||||
Fin
|
||||
|
||||
|
||||
5
IUT/Info1/TD/Exercices/8.4_fibo/.txt
Normal file
5
IUT/Info1/TD/Exercices/8.4_fibo/.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
a = 1
|
||||
b = 2
|
||||
temp =
|
||||
|
||||
temp = 2
|
||||
7
IUT/Info1/TD/Exercices/8.4_fibo/fonctions.cpp
Normal file
7
IUT/Info1/TD/Exercices/8.4_fibo/fonctions.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
int fib(int a, int b, int n) {
|
||||
int temp;
|
||||
|
||||
for (unsigned int i = 0; i < n; i++) {
|
||||
|
||||
}
|
||||
}
|
||||
1
IUT/Info1/TD/Exercices/8.4_fibo/fonctions.h
Normal file
1
IUT/Info1/TD/Exercices/8.4_fibo/fonctions.h
Normal file
@@ -0,0 +1 @@
|
||||
int fib(int a, int b, int n);
|
||||
0
IUT/Info1/TD/Exercices/8.4_fibo/main.cpp
Normal file
0
IUT/Info1/TD/Exercices/8.4_fibo/main.cpp
Normal file
12
IUT/Info1/TD/Exercices/8.4_fibo/t.py
Normal file
12
IUT/Info1/TD/Exercices/8.4_fibo/t.py
Normal file
@@ -0,0 +1,12 @@
|
||||
def fib(
|
||||
n: int,
|
||||
memo: dict[int, int]
|
||||
):
|
||||
memo[n-2] = a
|
||||
memo[n-1] = b
|
||||
|
||||
|
||||
|
||||
return fib()
|
||||
|
||||
print(fib(0, 1, 10))
|
||||
Reference in New Issue
Block a user