Skip to content

Commit 260ba8d

Browse files
committed
syntax correction
1 parent 412d3ff commit 260ba8d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

math/fibonacci.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
#include <iostream>
21
#include <cassert>
2+
#include <iostream>
33

44
/* Calculate the the value on Fibonacci's sequence given an
55
integer as input
66
Fibonacci = 0, 1, 1, 2, 3, 5,
77
8, 13, 21, 34, 55,
88
89, 144, ... */
99

10-
int fibonacci(uint n) {
10+
int fibonacci(unsigned int n) {
1111
/* If the input is 0 or 1 just return the same
1212
This will set the first 2 values of the sequence */
13-
if (n <= 1)
14-
return n;
13+
if (n <= 1) return n;
1514

1615
/* Add the last 2 values of the sequence to get next */
17-
return fibonacci(n-1) + fibonacci(n-2);
16+
return fibonacci(n - 1) + fibonacci(n - 2);
1817
}
1918

2019
int main() {

0 commit comments

Comments
 (0)