#include<stdio.h> int Fun(int n) { if (n==1) { return 1; } if (n==2) { return 2; } else { return (Fun(n - 1) + Fun(n - 2)); } } int Fun2(int n) { if (n == 1) { return 2; } if (n == 2) { return 3; } else { return (Fun2(n - 1) + Fun2(n - 2)); } } int main() { int n = 0, i = 0; double count1 = 0, count2 = 0, sum = 0, divide = 0; scanf("%d", &n); for ( i = 1; i <= n; i++) { double res = 1.0 * Fun(i); double res2 = 1.0 * Fun2(i); divide = res2 / res; sum = sum + divide; } printf("%.2lf\n", sum); return 0; }
0.0分
0 人评分