Skip to content

Commit

Permalink
small formatting improvement coders-school#2
Browse files Browse the repository at this point in the history
  • Loading branch information
apietrzyk92 committed Jan 10, 2023
1 parent 2cb35cd commit e994656
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homework/fibonacci/fibonacci.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
int fibonacci_iterative(int sequence) {
int a0 = 0;
int a1 = 1;
for(int i = 0; i < sequence; i++) {
for (int i = 0; i < sequence; i++) {
a1 += a0;
a0 = a1 - a0;
}
Expand All @@ -16,6 +16,6 @@ int fibonacci_recursive(int sequence) {
} else if (sequence < 3) {
return 1;
} else {
return fibonacci_recursive(sequence - 1)+fibonacci_recursive(sequence - 2);
return fibonacci_recursive(sequence - 1) + fibonacci_recursive(sequence - 2);
}
}

0 comments on commit e994656

Please sign in to comment.