#include
main()
{
float x,y;
printf("请输入未知数x\n");
scanf("%f",&x);
if (x<1)
{ y=x;
printf("y=%f\n", y);
}
else if(x<10)
{y=2*x-1;
printf("y=%f\n", y);
}
else
{ y=3*x-11;
printf("y=%f\n", y);}
}
程序已测试,望采纳!!
float main(float x){
float y;
if(x < 1){
y = x;
}else if( x < 10){
y = 2 * x - 11;
}else{
y = 3 * x - 11
}
return y;
}