main()
{
float x,y;
printf("x=");
scanf("%f",&x);
if(x<0) y=0;
else
if(x<10) y=x;
else
if(x<20) y=10;
else y=-0.5*x+20;
printf("y=%f,",y);
} 怎么if用不了啊。。。。。。
{
float x,y;
printf("x=");
scanf("%f",&x);
if(x<0) y=0;
else
if(x<10) y=x;
else
if(x<20) y=10;
else y=-0.5*x+20;
printf("y=%f,",y);
} 怎么if用不了啊。。。。。。

顺其自然随遇而安。