From e9a0cb266ea04d57f8c8fa5c143da8be32a838f1 Mon Sep 17 00:00:00 2001 From: flykhan Date: Fri, 16 Jun 2023 16:33:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E7=AC=A6=E5=8F=B7=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day5/d2.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 day5/d2.cpp 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