namespace myNum
{
int x = 106;
}
using namespace myNum;
int main()
{
bool isFlag = false;
if(x % 2 == 0)
{ isFlag=false;
}
else
{
isFlag=true;
}
if(isFlag)
{
cout<<x<<"是奇数"<<endl;
}
else
{cout<<x<<"是偶数"<<endl;
}
return 0;}
{
int x = 106;
}
using namespace myNum;
int main()
{
bool isFlag = false;
if(x % 2 == 0)
{ isFlag=false;
}
else
{
isFlag=true;
}
if(isFlag)
{
cout<<x<<"是奇数"<<endl;
}
else
{cout<<x<<"是偶数"<<endl;
}
return 0;}
namespace myNum
{
int x = 105;
}
int main()
{
bool isFlag = false;
if(myNum::x % 2 == 0)
{
isFlag=false;
}
else
{
isFlag=true;
}
if(isFlag)
{
cout<<myNum::x<<"是奇数"<<endl;
}
else
{
cout<<myNum::x<<"是偶数"<<endl;
}
return 0;
}
{
int x = 105;
}
int main()
{
bool isFlag = false;
if(myNum::x % 2 == 0)
{
isFlag=false;
}
else
{
isFlag=true;
}
if(isFlag)
{
cout<<myNum::x<<"是奇数"<<endl;
}
else
{
cout<<myNum::x<<"是偶数"<<endl;
}
return 0;
}
IDE可以选择VC6++,DEV-C++,Code::Blocks,VS中的任一个,都能作为C++的开发环境,不过VS功能比较强大,还能编译其他语言就是了
2017-07-26
int main(){
bool isFlag = false;
if(myNum::x % 2 == 0){
isFlag = false;
}else{
isFlag = true;
}
if(isFlag){
cout << "变量" << myNum::x << "是奇数" << endl;
}else
{
cout << "变量" << myNum::x << "是偶数" << endl;
}
return 0;
}
bool isFlag = false;
if(myNum::x % 2 == 0){
isFlag = false;
}else{
isFlag = true;
}
if(isFlag){
cout << "变量" << myNum::x << "是奇数" << endl;
}else
{
cout << "变量" << myNum::x << "是偶数" << endl;
}
return 0;
}