运行 ❯
获取您
自己
的网站
×
更改方向
更改主题,深色/浅色
转到 Spaces
#include <iostream> using namespace std; int main() { int myInt = 4294967292; unsigned int myUInt = 4294967292; short int mySInt = 65532; unsigned short int myUSInt = 65532; long int myLInt = 18446744073709551612; unsigned long int myULInt = 18446744073709551612; cout << " size: " << 8*sizeof(myInt) << " bits value: " << myInt << "\n"; cout << " size: " << 8*sizeof(myUInt) << " bits value: " << myUInt << "\n"; cout << " size: " << 8*sizeof(mySInt) << " bits value: " << mySInt << "\n"; cout << " size: " << 8*sizeof(myUSInt) << " bits value: " << myUSInt << "\n"; cout << " size: " << 8*sizeof(myLInt) << " bits value: " << myLInt << "\n"; cout << " size: " << 8*sizeof(myULInt) << " bits value: " << myULInt << "\n"; return 0; }
大小: 32 位 值: -4
大小: 32 位 值: 4294967292
大小: 16 位 值: -4
大小: 16 位 值: 65532
大小: 64 位 值: -4
大小: 64 位 值: 18446744073709551612