Find whether a number is positive or negative, or odd or even

From , 3 Years ago, written in C++, viewed 199 times.
URL https://pastebin.vip/view/07811dc6
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.     int a;
  6.     cin >>a;
  7.     if(a<0&&a%2==-1)
  8.     cout << "负奇数"<<endl;
  9.     else if(a>0&&a%2==1)
  10.     cout << "正奇数"<<endl;
  11.     else if(a<0&&a%2==0)
  12.     cout << "负偶数"<<endl;
  13.     else
  14.     cout << "正偶数"<<endl;
  15.     return 0;
  16. }
  17.  

Reply to "Find whether a number is positive or negative, or odd or even"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website