#include
创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都网站设计、网站建设、外贸网站建设、仁化网络推广、成都微信小程序、仁化网络营销、仁化企业策划、仁化品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供仁化建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com
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");
}
#includestdio.h
int main()
{
int x,y;
scanf("%d",x);
if(x-10)
y=0;
else if(x100) y=5*x+1;
else
y = 5*x + 1; //这个表达式的值是什么啊
printf("%d\n",y);
return 0;
}
#include "stdio.h"
#include "math.h"
int main(int argc,char *argv[]){
double x,y;
printf("Input x(R:)...\nx=");
scanf("%lf",x);
if(x5)
y=-x+3.5;
else if(x=5 x10)
y=20-3.5*pow(x+3,7);//这里看着像7,是几就把7改成几
else
y=-3.5+sin(x);
printf("y = %g\t(x==%g)\n",y,x);
return 0;
}
运行样例:
#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"); }
采纳哦