请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。不得增行或删行,也不得更改程序的结构!
给定源程序:
#include
#include
double fun(double x, int n)
{double f, t; int i;
/**********found**********/
f = ___1___;
t = -1;
for (i=1; i
{
/**********found**********/
t *= (___2___)*x/i;
/**********found**********/
f += ___3___;
}
return f;
}
main()
{double x, y;
x=2.5;
y = fun(x, 15);
printf("\nThe result is :\n");
printf("x=%-12.6f y=%-12.6f\n", x, y);
}
解题答案:
/**********found**********/
f = 1;
/**********found**********/
t *= (-1)*x/i;
/**********found**********/
f += t;
******************************************
更多此系列试题汇总:
相关专题:
相关推荐: