#include<iostream>#include<climits>usingnamespacestd;intmain(intargc,charconst*argv[]){intn_int=INT_MAX;shortn_short=SHRT_MAX;longn_long=LONG_MAX;longlongn_llong=LLONG_MAX;std::cout<<"int is "<<CHAR_BIT<<" bytes."<<'\n';std::cout<<"short is "<<sizeof(short)<<" bytes."<<'\n';std::cout<<"long is "<<sizeof(long)<<" bytes."<<'\n';std::cout<<"long long is "<<sizeof(longlong)<<" bytes."<<'\n';std::cout<<"Maxinum values:"<<'\n';std::cout<<"int : "<<n_int<<'\n';std::cout<<"short : "<<n_short<<'\n';std::cout<<"long : "<<n_long<<'\n';std::cout<<"long long : "<<n_llong<<'\n';std::cout<<"Bits per byte : "<<CHAR_BIT<<'\n';return0;}-----------------------------------------------------------------------------------结果:intis8bytes.shortis2bytes.longis4bytes.longlongis8bytes.Maxinumvalues:int:2147483647short:32767long:2147483647longlong:9223372036854775807Bitsperbyte:8