27、给定程序中,函数fun的功能是根据形参i的值返回某个函数的值。当调用正确时, 程序输出:
x1=5.000000, x2=3.000000, x1*x1+x1*x2=40.000000
请在程序的下划线处填入正确的内容并把下划线删除, 使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
#include double f1(double x)
{ return x*x; }
double f2(double x, double y)
{ return x*y; }
/**********found**********/
__1__ fun(int i, double x, double y)
{ if (i==1)
/**********found**********/
return __2__(x);
else
/**********found**********/
return __3__(x, y);
}
main()
{ double x1=5, x2=3, r;
r = fun(1, x1, x2);
r += fun(2, x1, x2);
printf("\nx1=%f, x2=%f, x1*x1+x1*x2=%f\n\n",x1, x2, r);
}
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|