一道数学题 1,当x<1时,输出X;2,当1<=x
#include<stdio.h>int main()
{
double x,y;
printf("请输入X的值\n");
scanf("%f",&x);
if(x<10)
{
if(x<1)
printf("%f\n",x);
else
y=2*x-1;
printf("%f\n",y);
}
else
y=3*x-11;
printf("%f\n",y);
return 0;
}
else y=3*x-11; printf("%f\n",y);