请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
给定源程序:
#include
double fun(double e)
{int i, k; double s, t, x;
s=0; k=1; i=2;
/**********found**********/
x=__1__/4;
/**********found**********/
while(x __2__ e)
{s=s+k*x;
k=k* (-1);
t=2*i;
/**********found**********/
x=__3__/(t*t);
i++;
}
return s;
}
main()
{double e=1e-3;
printf("\nThe result is: %f\n",fun(e));
}
解题答案:
/**********第一空**********/
x=3./4;
/**********第二空*********/
while(x > e)
/**********第三空*********/
x=(2*i+1)/(t*t);
******************************************
相关专题:
编辑推荐: