总时间限制: 1000ms 内存限制: 65536kB
描述
给定一个整数N,判断其正负。
输入输出简介
输入
一个整数N(-109 <= N <= 109)
输出
如果N > 0, 输出positive;
如果N = 0, 输出zero;
如果N < 0, 输出negative;
样例输入
1
样例输出
negative
这道题其实很简单 只要一个多重if条件判断:
#include<iostream>
using namespace std;
int main(){
int N;
cin >> N;
if(N > 0){
cout<<"negative";
return 0;
}
if(N == 0){
cout<<"zero";
return 0;
}
if(N > 0){
cout<<"positive";
return 0;
}
}