#include<stdio.h>
int sign(int n)//函数申明,定义函数 
{
    int m;
    if(n>0)
    m=1;
    if(n==0)
    m=0;
    if(n<0)
    m=-1;
    return m;//返回结果 
} 

int main(void)//主函数 
{
    int x,y;
    while(scanf("%d",&x)!=EOF)
    {
        y=sign(x);
        printf("%d\n",y);
    }
    return 0; 
}

 

相关文章:

  • 2021-12-17
  • 2021-07-03
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2022-01-19
猜你喜欢
  • 2022-02-07
  • 2021-08-06
  • 2021-08-05
  • 2021-04-12
  • 2022-12-23
  • 2021-05-13
相关资源
相似解决方案