作业3.1

#include<stdio.h>

int main(void)

{

         int x,y;

         printf("Enter x:");

         scanf("%d",&x);

 

         if(x<=0){

                   y=-1;

                   printf("%d",y);

         }

         else if(x=0){

                   y=0;

                   printf("%d",y);

         }

         else{

                   y=1;

         printf("%d",y);

         }

         return 0;

}

posted @ 2013-10-19 20:24  zhaoyang16  阅读(84)  评论(0编辑  收藏  举报