无符号数

This commit is contained in:
flykhan 2023-06-16 16:33:51 +08:00
parent e5373892a1
commit e9a0cb266e
1 changed files with 14 additions and 0 deletions

14
day5/d2.cpp Normal file
View File

@ -0,0 +1,14 @@
// 无符号数
#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;
}