01.判断数正负

描述

给定一个整数N,判断其正负

输入

一个整数N(-109 <= N <= 109)

输出

如果N > 0, 输出positive;
如果N = 0, 输出zero;
如果N < 0, 输出negative

样例输入

1

样例输出

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

发布了30 篇原创文章 · 获赞 3 · 访问量 380

猜你喜欢

转载自blog.csdn.net/qq_45748133/article/details/104330445
01.