有函数如下所示,请编程实现输入一个x值,输出对应y的值。
#include<stdio. h>
int main()
{
int x,y;
printf("please input x:");
scanf("%d",&x); //从键盘接收x的值
if(x<0) //判断x的值,执行相应语句
y=x+1;
else
if(x==0)y=x;
else y=x-1;
printf("y=%d\n",y);
return 0;
}