feature/algoritmo #1

Merged
PatrickReisSantos merged 10 commits from feature/algoritmo into master 2022-11-02 16:06:18 +00:00
Showing only changes of commit ec60fd0248 - Show all commits

View File

@ -1,4 +1,16 @@
export function fibonacci(value) {
let soma = 0;
let anterior = 0;
let proximo = 1;
if (value == 1) {
return (soma = 1);
}
for (let i = 2; i <= value; i++) {
soma = anterior + proximo;
anterior = proximo;
proximo = soma;
}
return soma;
// implementar logica aqui
}
}