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; +}