[问答题]

给定程序中,函数fun的功能是计算下式:
  ,直到
  并把计算结果作为函数值返回。
  例如:若形参e的值为1e-3,函数的返回值为0.551690。
  请在程序的下划线处填入正确的内容并把下划线删除.使程序得出正确的结果。注意:源程序存放在考生文件夹下的BLANKC中。
  不得增行或删行,也不得更改程序的结构!
/**********code.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;
}
void main()
{
   double  e=1e-3;
   printf(" The result is: %f ",fun(e));
}
/**********-code.c**********/

参考答案与解析:

相关试题

给定程序中,函数fun的功能是计算下式:<br />  <img border="0" src="https://img.zhaotiba.com/fu