0
点赞
收藏
分享

微信扫一扫

1039:判断数正负

程序员阿狸 2022-01-06 阅读 71
c++

给定一个整数NN,判断其正负。如果N>0N>0,输出positive;如果N=0N=0,输出zero;如果N<0N<0,输出negative

#include <iostream>
using namespace std;
int main()
{   
   int N;
   cin>>N;
   if(N>0)
   cout<<"positive";
   if(N==0)
   cout<<"zero";
   if(N<0)
   cout<<"negative";
    return 0;
}

举报

相关推荐

0 条评论