作业三(1)

#include<stdio.h>
int main(void)
{
    int x,y;
    printf("Enter x:\n");
    scanf_s("%d",&x);

    if(x<0){
      y = -1;
    }
    else if(x==0){
        y=0;
    }
    else{
        y=1;
    }
   printf("y=%d\n",y); 
    
   return 0;
}

 

posted @ 2013-10-19 22:57  wuyanlong  阅读(89)  评论(0编辑  收藏  举报