#include
#include
double y(double x)
{
if (x<=15) return (2*pow(x,2)-6*x+9);
else if(x<=30) return 6;
else if(x<=45) return (pow(x,3)-5*pow(x,2)+sqrt(5*x));
}
int main()
{
double x;
int i;
for(i=1;i<=3;i++)
{
printf("请输入第%d个x的值:",i);
scanf("%lf",&x);
printf("%.2f对应的y值为:%.2f\n",x,y(x));
}
return 0;
}