题解 | #计算y的值#
计算y的值
http://www.nowcoder.com/practice/61a0f16117484d219b59c62224b33b1c
#include<stdio.h>
int main()
{
int x=0,y;
scanf("%d",&x);
if(x<0)
{
y=1;
}
if(x==0)
{
y=0;
}
if(x>0)
{
y=-1;
}
printf("%d",y);
return 0;
}