【程序设计】
时间限制 1 s
空间限制 125 MB
/*------------------------------------------------
【程序设计】
--------------------------------------------------
功能:编写函数fun计算下列分段函数的值:
x^2+x+6 x<0且x≠-3
f(x)= x^2-5x+6 0≤x<10且x≠2及x≠3
x^2-x-1 其它
------------------------------------------------*/
#include <stdio.h>
float fun(float x)
{
/*Program*/
/********** End **********/
}
main()
{
float x,f;
printf("input x=");
scanf("%f",&x);
f=fun(x);
printf("x=%f,f(x)=%f\n",x,f);
}
代码
编辑器
请先登录后再提交代码。