#include "stdafx.h"
#include <iostream>
#include <stdlib.h>
using namespace std
namespace myNum{int x = 150;}
int main(){
bool isFlag = false;
if (myNum::x % 2 == 0){
isFlag = false;}
else{isFlag = true;}
if (myNum::x % 2 == 1){
cout << "X 是 奇数" << endl;}
else{
cout << "x 是偶数" << endl;}
return 0;}
#include <iostream>
#include <stdlib.h>
using namespace std
namespace myNum{int x = 150;}
int main(){
bool isFlag = false;
if (myNum::x % 2 == 0){
isFlag = false;}
else{isFlag = true;}
if (myNum::x % 2 == 1){
cout << "X 是 奇数" << endl;}
else{
cout << "x 是偶数" << endl;}
return 0;}
#include <iostream.h>
void main()
{
int x = 105;
bool isFlag = false;
if(x % 2 == 0)
{
cout<<"false";
}
else
{
cout<<"true"<<endl;
}
if(isFlag=true)
{
cout<<"x是奇数";
}
else
{
cout<<"x是偶数";
}
}
//VC++6.0这样改过之后能运行,不造为什么原代码不能运行。
void main()
{
int x = 105;
bool isFlag = false;
if(x % 2 == 0)
{
cout<<"false";
}
else
{
cout<<"true"<<endl;
}
if(isFlag=true)
{
cout<<"x是奇数";
}
else
{
cout<<"x是偶数";
}
}
//VC++6.0这样改过之后能运行,不造为什么原代码不能运行。