mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-15 03:10:07 +08:00
formatting source-code for 153fb7b8a5
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int fib(int n)
|
||||
{
|
||||
int fib(int n) {
|
||||
int res[3];
|
||||
res[0] = 0;
|
||||
res[1] = 1;
|
||||
for (int i = 2; i <= n; i++)
|
||||
{
|
||||
for (int i = 2; i <= n; i++) {
|
||||
res[2] = res[1] + res[0];
|
||||
res[0] = res[1];
|
||||
res[1] = res[2];
|
||||
}
|
||||
return res[1];
|
||||
}
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
int main(int argc, char const *argv[]) {
|
||||
int n;
|
||||
cout << "Enter n: ";
|
||||
cin >> n;
|
||||
|
||||
Reference in New Issue
Block a user