namespace myNum
{
int x = 105;
}
int main()
{
bool isOdd = false;
if(myNum::x % 2 == 0)
{
isOdd=false;
}
else
{
isOdd=true;
}
if(isOdd=true)
{
cout<<"x是奇数"<<endl;
}
else
{
cout<<"x是偶数"<<endl;
}
return 0;
}
{
int x = 105;
}
int main()
{
bool isOdd = false;
if(myNum::x % 2 == 0)
{
isOdd=false;
}
else
{
isOdd=true;
}
if(isOdd=true)
{
cout<<"x是奇数"<<endl;
}
else
{
cout<<"x是偶数"<<endl;
}
return 0;
}
#include <iostream>
#include <stdlib.h>
using namespace std;
namespace myNum {
int x = 105;
}
int main()
{
bool isOdd = false;
if(myNum::x % 2 == 0)
{
isOdd =0;
}
else
{
isOdd =1;
}
if(isOdd =1)
{
cout<<"变量x是奇数"<<endl;
}
else
{
cout<<"变量x是偶数"<<endl;
}
return 0;
}
#include <stdlib.h>
using namespace std;
namespace myNum {
int x = 105;
}
int main()
{
bool isOdd = false;
if(myNum::x % 2 == 0)
{
isOdd =0;
}
else
{
isOdd =1;
}
if(isOdd =1)
{
cout<<"变量x是奇数"<<endl;
}
else
{
cout<<"变量x是偶数"<<endl;
}
return 0;
}