#include
#include
double fun(double x)
{
if (x<=0)return(-x+3);
else if(x<1)return 1+x*x;
else return 2*x+sqrt(x);
}
int main()
{
double x;
scanf("%lf",&x);
printf("y=%lf \n",fun(x));
system("pause");
return 0;
}
#include
double func(double x)
{
if (x <= 0) {
return (-x + 3);
} else if (x < 1) {
return (1 + x*x);
} else {
return 2 * x + sqrt(x);
}
}
啊咧?题目呢?
函数在哪里?