FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Dynamic-Programming/fibonacci.cpp at master · shiningflash/Dynamic-Programming · GitHub
shiningflash
/
Dynamic-Programming
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Dynamic-Programming
/
fibonacci.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (28 loc) · 484 Bytes
Breadcrumbs
Dynamic-Programming
/
fibonacci.cpp
Copy path
File metadata and controls
36 lines (28 loc) · 484 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
include
<
bits/stdc++.h
>
using
namespace
std
;
#
define
ll
long
long
int
const
int
mx =
40
;
ll fib[mx];
void
fibonacci
() {
fib[
0
] =
0
;
fib[
1
] =
1
;
for
(
int
i =
2
; i <= mx; i++) {
fib[i] = fib[i-
1
] + fib[i-
2
];
}
}
void
print_series
() {
for
(
int
i =
0
; i < mx; i++) {
cout << fib[i] <<
"
"
;
}
cout <<
"
\n
"
;
}
int
main
() {
fibonacci
();
print_series
();
return
0
;
}
/*
Output
-
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 ....
*/
Back
|
FazBrowse Home
|
New Git URL