14、给定程序中,函数fun的功能是计算下式
例如:若形参e的值为1e-3,函数的返回值为0.551690。
请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的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));
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>