#include<stdio.h>
int qiuhe()
{
int i=0;
int a=1;
int b=1;
double t=0;
double s=0;
for(i=1;i<=20;i++)
{
t=a+b;
s=s+t/a;
b=a;
a=t;
}
return s;
}
int main()
{
double ret=qiuhe();
printf("%lf",ret);
return 0;
}
转载于:https://blog.51cto.com/10740329/1705309