#include<stdio.h>标签:13,20,int,sum,float,序列 From: https://blog.51cto.com/u_15806064/5949482
int main()
{
int i=0;
float sum =0;
float a=2,b=1;
for(i=1;i<=20;i++)
{
sum=sum+a/b;
int c=a;
a=a+b;
b=c;
}
printf("sum = %f\n",sum);
return 0;
}
#include<stdio.h>标签:13,20,int,sum,float,序列 From: https://blog.51cto.com/u_15806064/5949482
int main()
{
int i=0;
float sum =0;
float a=2,b=1;
for(i=1;i<=20;i++)
{
sum=sum+a/b;
int c=a;
a=a+b;
b=c;
}
printf("sum = %f\n",sum);
return 0;
}