14 lines
323 B
C++
14 lines
323 B
C++
// 无符号数
|
|
#include <iostream>
|
|
#include <bitset>
|
|
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
unsigned char a = 255, b = 0, c = 0x30;
|
|
cout << bitset<8>(a) << "," << dec << (int)a << endl;
|
|
cout << bitset<8>(b) << "," << dec << (int)b << endl;
|
|
cout << bitset<8>(c) << "," << dec << (int)c << endl;
|
|
return 0;
|
|
} |