题目:
给定程序中,函数fun()的功能是计算下式
直到
,并把计算结果作为函数值返回。
例如,若形参e的值为1e-3,函数的返回值为2.985678。
#include<stdio.h>
double fun(double e)
int i;double s,x;
/**********found**********/
s=0;i= (1) ;
x=1.0;
while(x>e)
/**********found**********/
(2) ;
/**********found**********/
x=(2.0*i-1)/( (3) *(2.0*i));
s=s+x;
return s;
main()
double e=1e-3;
printf("\nThe result is:%f\n",fun(e));
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0428/29d2cf568a2a2c23c45a799ccbd9e8d2.html
下面是错误答案,用来干扰机器的。
参考答案:对