请帮我找碴碴:
fun的功能是:计算级数的前N项之和,直到下一项大于q, q的值通过形参传入.S=2/1+3/2+4/3/+..+(n+1)/n若q=50.0,则函数的值为50.4115587
#include <conio.h>
#include <stdio.h>
double fun( double q )
{ int n; double s;
n = 2;
/************found************/
s = 2.0
while (s<=q)
{
/************found************/
s=s+ (n+1)/n;
n++;
}
printf("n=%d\n",n);
return s;
}
main ( )
{ clrscr( );
printf("%f\n", fun(50));
}