#include<iostream>
using namespace std;
void func(int a )
{
if (a>0)
{
if (a%2==1)
{
cout << "a is a positive odd number" << endl;
}
else
{
cout << "a is a positive even number\n";
}
}
else if (a<0 && abs(a)%2==1)
{
cout << "a is a negative odd number\n";
}
else if (a==0){
cout << "a is 0\n";
}
else
{
cout << "a is a nagative even number\n";
}
if (a>0 || a==0)
{
cout << "a is not negative\n";
}
}
int main(){
int a;
cout << "enter number a :" << endl;
cin >> a;
func(a);
return 0;
}`在这里插入代码片`