01:判断数正负
作者:互联网
OpenJudge-1.4编程基础之逻辑表达式与条件分支-01:判断数正负
总Time Limit: 1000ms Memory Limit: 65536kB
Description
给定一个整数N,判断其正负。
Input
一个整数N(-109 <= N <= 109)
Output
如果N > 0, 输出positive;
如果N = 0, 输出zero;
如果N < 0, 输出negative
Sample Input
1
Sample Output
positive
Source
yty
C++ Code
#include <iostream>
using namespace std;
int main()
{
int a;
cin>>a;
if(a>0)
cout<<"positive";
else if(a<0)
cout<<"negative";
else
cout<<"zero";
return 0;
}
标签:01,int,positive,Limit,判断,正负,Input 来源: https://www.cnblogs.com/huishou1981/p/14351581.html