#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這樣改過之后能運行,不造為什么原代碼不能運行。