变量最大值及字节数
#include "iostream"
#include "climits"
int main(){
using namespace std;
int n_int = INT_MAX;
long long n_llong = LLONG_MAX;
cout << "int is " << sizeof (int) << " bytes." << endl;
cout << "long long is " << sizeof n_llong << " bytes." << endl;
cout << "MAX int value is " << n_int << endl;
cout << "Bits per byte = " << CHAR_BIT << endl;
return 0;
}

浙公网安备 33010602011771号