int main(int argc, char* argv[])
{
cout << "请输入一个整数" << endl;
int i;
cin >> i;
cout << "八进制:" << oct << i << ",";
cout << "十六进制:" << hex << i << ",";
cout << "十进制:" << i << ",";
cout << "布尔值:" << boolalpha << (bool)i << endl;
cin.get();
cin.get();
return 0;
}
{
cout << "请输入一个整数" << endl;
int i;
cin >> i;
cout << "八进制:" << oct << i << ",";
cout << "十六进制:" << hex << i << ",";
cout << "十进制:" << i << ",";
cout << "布尔值:" << boolalpha << (bool)i << endl;
cin.get();
cin.get();
return 0;
}
2016-08-22
namespace myNum;
{
int x = 105;
}
int main()
{
bool isOdd;
bool isFlag = 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;
bool isFlag = 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=false;}
else
{isOdd=true;}
if(isOdd)
{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=false;}
else
{isOdd=true;}
if(isOdd)
{cout<<"变量x是奇数"<<endl;
}
else
{cout<<"变量X是偶数"<<endl;
}
return 0;
}