13 lines
197 B
C++
13 lines
197 B
C++
|
// 测试负数的二进制表示:补码方式存储
|
||
|
#include <iostream>
|
||
|
#include <bitset>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int x = -123;
|
||
|
cout << bitset<8>(x) << endl;
|
||
|
return 0;
|
||
|
}
|