#include<iostream>
#include<bitset>
using namespace std;
int main()
{
int n;
cout << "Please enter a decimal number :" << endl;
cin >> n;
bitset<8>bs(n);
cout <<"Binary : "<<bs << endl;
cout <<"Octal : "<<oct<<n<<endl;
cout <<"Decimal : "<<dec << n << endl;
cout <<"Hexadecimal : "<< hex << n << endl;
return 0;
}
C++进制转换
最新推荐文章于 2024-03-30 21:24:19 发布