#include
int main(){
int x,y;
printf("输入x的值:");
scanf("%d",&x);
if(x<=1)y=x;
else if(x>1&&x<10)y=2*x-1;
else if(x>=10)y=3*x-11;
printf("y=%d\n",y);
return 0;
}
#include
int main()
{
int x,y;
printf("please input a number:\n");
scanf("%d\n",&x);
if(x<=1)
{
y=x;
printf("y=%d\n",y);
}
else if(x>1&&x<10)
{
y=2*x-1;
printf("y=%d\n",y);
}
else
{
y=3*x-11;
printf("y=%d\n",y);
}
return 0;
}
#include
void main(){
float x;
printf("请输入x=");
scanf("%f",&x);
if(x<=1) printf("y=%g",x);
else if (x<10) printf("y=%g",2*x-1);
else printf("y=%g",3*x-11);
}