From 1f93e821edc355350ad1b5a0831826f01a13fdc4 Mon Sep 17 00:00:00 2001 From: flykhan Date: Fri, 16 Jun 2023 16:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B4=9F=E6=95=B0=E7=9A=84?= =?UTF-8?q?=E4=BA=8C=E8=BF=9B=E5=88=B6=E8=A1=A8=E7=A4=BA=EF=BC=9A=E8=A1=A5?= =?UTF-8?q?=E7=A0=81=E6=96=B9=E5=BC=8F=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day5/d4.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 day5/d4.cpp diff --git a/day5/d4.cpp b/day5/d4.cpp new file mode 100644 index 0000000..6bc2f6b --- /dev/null +++ b/day5/d4.cpp @@ -0,0 +1,12 @@ +// 测试负数的二进制表示:补码方式存储 +#include +#include + +using namespace std; + +int main() +{ + int x = -123; + cout << bitset<8>(x) << endl; + return 0; +}