Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
main
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ProjetoIntegrador2018
M
minicurso
poo
main
Commits
98a6fccc
Commit
98a6fccc
authored
Aug 27, 2018
by
Henrique de Souza Santana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fibonacci
parent
a6e613d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
Fibonacci.java
src/Fibonacci.java
+21
-0
No files found.
src/Fibonacci.java
0 → 100644
View file @
98a6fccc
//Classe relativa à Sequência de Fibonacci
public
class
Fibonacci
{
public
static
int
enesimoTermo
(
int
n
)
{
int
anterior
=
1
,
anteanterior
=
1
,
atual
=
2
;
if
(
n
<
1
)
return
0
;
// Fora da sequência
else
if
(
n
<
3
)
return
1
;
else
{
for
(
int
i
=
3
;
i
<
n
;
i
++)
{
anteanterior
=
anterior
;
anterior
=
atual
;
atual
=
anteanterior
+
anterior
;
}
return
atual
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment