#include
#include
main()
{
float x, y;
printf("请输入x和y的值:");
scanf("%f%f"缺穗棚, &x, &y);
if(x<1)
y=x;
else if(x>=1&&x<10)
y=2*x-1;
else if(x>=10)
y=3*x-11;
printf("The result is %f.", y);
system("pause");
return 0;
}
这是族消用C语言编写的,不知伏则道是不是你想要的
#include
#include
void main()
{
float x, y;
printf("请输旅困入x的值:");
scanf("%f", &x);
if(x<1)
y=x;
else if(x>=10)
y=3*x-11;
else
y=2*x-1;
printf("\谨顷r\ny值为:%f", y);
return 0;
}
#include
void main()
{
int x,y;
scanf("%f",&x);
if(x<1)
{
y=x;
printf("%f",y);
}
else if(>握虚宽弯=10)
{
y=3*x-11;
printf("%f",y);
}
else
{
y=2*x-1;
printf("%f",y);
}
}