main()
{double?x,y1,y2;
while(1){
printf("x?=?");
scanf("%lf",&x);
//(方法1)
if(x>-5&&x<0)?y1=x;
if(x==0)?y1=x-1;
if(x>0&&x<10)?y1=x+1;
printf("y1?=?%lf\n",y1);
//(方法2)
if(x>-5&&x<0)?y2=x;
else?if(x==0)?y2=x-1;
else?if(x>0&&x<10)?y2=x+1;
printf("y2?=?%lf\n",y2);
}
}
如圖所示,望采納。。。。。。