diff --git a/day5/d2.cpp b/day5/d2.cpp new file mode 100644 index 0000000..784141b --- /dev/null +++ b/day5/d2.cpp @@ -0,0 +1,14 @@ +// 无符号数 +#include +#include + +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; +} \ No newline at end of file