2022-10-27 15:07:13 +00:00
|
|
|
export function fibonacci(value) {
|
|
|
|
// implementar logica aqui
|
2022-10-29 03:18:27 +00:00
|
|
|
let soma = 0;
|
|
|
|
let n1 = 0;
|
|
|
|
let n2 = 1;
|
|
|
|
|
|
|
|
for (let i = 0; i < value; i++) {
|
|
|
|
soma = n1 + n2
|
|
|
|
n1 = n2
|
|
|
|
n2 = soma
|
|
|
|
}
|
|
|
|
return n1;
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|