while(n<=10)//n=0恒小于10,所以进入死循环!
#include <stdio.h> #include <math.h> main() { float a=1.0,b=2.0,c,n=0,y; c=a+b; y=b/a+c/b; while(n<=10) { a=b; b=c; c=a+b; y+=c/b; n++; } printf("%f\n",y); }