//2/1+3/2+.....
#include <stdio.h>
int main()
{
double top = 2,under = 1,s=0;
int i,t;
for(i = 1; i<= 20; i++){
s = s + top/under;
t = top;
top = top +under;
under = t;
}
printf("s=%f",s);
}
通过观察,分母等于前一项的分子,而分子等于前一项的分子分母之和