You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
|
|
int main() {
|
|
int n, i;
|
|
double f[50];
|
|
f[0] = 0;
|
|
f[1] = 1;
|
|
f[2] = 1;
|
|
cin >> n;
|
|
|
|
for (i = 3; i <= n; i++)
|
|
f[i] = f[i - 1] + f[i - 2];
|
|
|
|
printf("%0.2lf", f[n]);
|
|
return 0;
|
|
}
|