int main(int argc, char* argv[])
{
cout << "請輸入一個整數(shù)" << endl;
int i;
cin >> i;
cout << "八進(jìn)制:" << oct << i << ",";
cout << "十六進(jìn)制:" << hex << i << ",";
cout << "十進(jìn)制:" << i << ",";
cout << "布爾值:" << boolalpha << (bool)i << endl;
cin.get();
cin.get();
return 0;
}
{
cout << "請輸入一個整數(shù)" << endl;
int i;
cin >> i;
cout << "八進(jìn)制:" << oct << i << ",";
cout << "十六進(jìn)制:" << hex << i << ",";
cout << "十進(jìn)制:" << 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<<"是奇數(shù)"<<endl;
}
else
{
cout<<x<<"是偶數(shù)"<<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<<"是奇數(shù)"<<endl;
}
else
{
cout<<x<<"是偶數(shù)"<<endl;
}
return 0;
2016-08-18
#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是奇數(shù)"<<endl;
}
else
{cout<<"變量X是偶數(shù)"<<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是奇數(shù)"<<endl;
}
else
{cout<<"變量X是偶數(shù)"<<endl;
}
return 0;
}
2016-08-14
namespace myNum
{
int x = 105;
}
int main()
{
bool isOdd=false,isFlag = false;
if(myNum::x % 2 == 0)
{
isOdd=true;
}
else
{
isFlag=true;
}
if(isFlag)
{
cout<<"變量x是奇數(shù)"<<endl;
}
else
{
cout<<"變量X是偶數(shù)"<<endl;
}
return 0;
}
{
int x = 105;
}
int main()
{
bool isOdd=false,isFlag = false;
if(myNum::x % 2 == 0)
{
isOdd=true;
}
else
{
isFlag=true;
}
if(isFlag)
{
cout<<"變量x是奇數(shù)"<<endl;
}
else
{
cout<<"變量X是偶數(shù)"<<endl;
}
return 0;
}
2016-08-14