mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-08 05:00:14 +08:00
clang-tidy fixes for a49ec9b8d7
This commit is contained in:
@@ -17,8 +17,9 @@
|
||||
unsigned int fibonacci(unsigned int n) {
|
||||
/* If the input is 0 or 1 just return the same
|
||||
This will set the first 2 values of the sequence */
|
||||
if (n <= 1)
|
||||
if (n <= 1) {
|
||||
return n;
|
||||
}
|
||||
|
||||
/* Add the last 2 values of the sequence to get next */
|
||||
return fibonacci(n - 1) + fibonacci(n - 2);
|
||||
@@ -58,7 +59,7 @@ static void test() {
|
||||
/// Main function
|
||||
int main() {
|
||||
test();
|
||||
int n;
|
||||
int n = 0;
|
||||
std::cin >> n;
|
||||
assert(n >= 0);
|
||||
std::cout << "F(" << n << ")= " << fibonacci(n) << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user