Fri, Aug 11, 2017, 03:05:50 PM
by GeekTown

#include <iostream>
#include <stdlib.h>
using namespace std;
namespace myNum
{
int x = 105;
}
int main()
{

bool isFlag = false;

if(myNum::x % 2 == 0)
{

bool isFlag = false;
}
else
{

bool isFlag = true;
}

if(isFlag)
{

cout <<"105ji"<<endl;
}
else
{
// 如果状态位的值为false,则打印变量x是偶数
cout << "105ou"<<endl;
}


return 0;
}

Fri, Aug 11, 2017, 03:05:23 PM
by GeekTown

#include <iostream>
#include <stdlib.h>
using namespace std;
namespace myNum
{
int x = 105;
}
int main()
{

bool isFlag = false;

if(myNum::x % 2 == 0)
{

bool isFlag = false;
}
else
{

bool isFlag = true;
}

if(isFlag)
{

cout <<"105是奇数"<<endl;
}
else
{
// 如果状态位的值为false,则打印变量x是偶数
cout << "105是偶数"<<endl;
}


return 0;
}

...............