十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
#include stdio.h #include math.h void main() { float x; double y; printf("Please input the value of x:"); scanf("%f",x); if(x=-10x=4) { y=fabs(x-2); printf("y=%.2f\n",y); } else if(x=5x=7) { y=x+10; printf("y=%.2f\n",y); } else if(x=8x=12) { y=pow(x,4); printf("y=%.2f\n",y); } else printf("No answer\n"); }
创新互联专注于漯河企业网站建设,成都响应式网站建设,成都商城网站开发。漯河网站建设公司,为漯河等地区提供建站服务。全流程专业公司,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务
采纳哦
#include stdio.h
#include math.h
int main()
{
float x,y;
printf("please input x:");
scanf("%f",x);
if(x0 x!=-3)
y = pow(x,2)+x-6;
else if(x=0 x10 x!=2 x!=3)
y = pow(x,2)-5*x+6;
else
y = pow(x,2)-x-1;
printf("y=%f\n",y);
return 0;
}
#include
int main()
{
int x,y;
scanf("%d",x);
if(0xx10) y=3*x+2;
else
{if(x=0) y=0;
else
{if (x0) y=x*x;
else printf("go die\n");
}
}
printf("%d",y);
return 0;
}该程序的分段函数如下:
f(x)=3x+2 (0x10)
f(x)=1 (x=0)
f(x) = x*x (x0)
#include stdio.h
#include math.h
void main()
{
float x;
double y;
printf("Please input the value of x:");
scanf("%f",x);
if(x=-10x=4)
{
y=fabs(x-2);
printf("y=%.2f\n",y);
}
else if(x=5x=7)
{
y=x+10;
printf("y=%.2f\n",y);
}
else if(x=8x=12)
{
y=pow(x,4);
printf("y=%.2f\n",y);
}
else
printf("No answer\n");
}