C++中各种类型的最大值和最小值

//Author:PanDaoxi
#include <iostream>
#include <climits>
using namespace std;
int main(){
	cout<<"最大值:"<<endl; 
	cout<<"int类型:"<<INT_MAX<<endl;
	cout<<"char类型:"<<CHAR_MAX<<endl;
	cout<<"short类型:"<<SHRT_MAX<<endl;
	cout<<"long类型:"<<LONG_MAX<<endl;
	cout<<"long long类型:"<<LLONG_MAX<<endl;
	cout<<"signed char类型:"<<SCHAR_MAX<<endl;
	cout<<"unsigned char类型:"<<UCHAR_MAX<<endl;
	cout<<"unsigned short类型:"<<USHRT_MAX<<endl;
	cout<<"unsigned int类型:"<<UINT_MAX<<endl;
	cout<<"unsigned long类型:"<<ULONG_MAX<<endl;
	cout<<"unsigned long long类型:"<<ULLONG_MAX<<endl; 
	cout<<endl<<endl<<"最小值:"<<endl;
	cout<<"char类型:"<<CHAR_MIN<<endl;
	cout<<"short类型:"<<SHRT_MIN<<endl;
	cout<<"int类型:"<<INT_MIN<<endl;
	cout<<"long类型:"<<LONG_MIN<<endl;
	cout<<"long long类型:"<<LLONG_MIN<<endl;
	cout<<"unsigned char类型:"<<SCHAR_MIN<<endl; 
	return 0;
} 
最大值:
int类型:2147483647
char类型:127
short类型:32767
long类型:2147483647
long long类型:9223372036854775807
signed char类型:127
unsigned char类型:255
unsigned short类型:65535
unsigned int类型:4294967295
unsigned long类型:4294967295
unsigned long long类型:18446744073709551615


最小值:
char类型:-128
short类型:-32768
int类型:-2147483648
long类型:-2147483648
long long类型:-9223372036854775808
unsigned char类型:-128

--------------------------------
Process exited after 0.533 seconds with return value 0
请按任意键继续. . .
上一篇:SQLServer Oracle MySQL被恶意软件加密不能使用c4h。


下一篇:sql 分页