测试负数的二进制表示:补码方式存储
This commit is contained in:
parent
896ab0ca76
commit
1f93e821ed
|
@ -0,0 +1,12 @@
|
|||
// 测试负数的二进制表示:补码方式存储
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int x = -123;
|
||||
cout << bitset<8>(x) << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue