头文件 :<limits>
求最大值 :(numeric_limits<Type>::max)()
求最小值: (numeric_limits<Type>::min)()
求所占字节:sizeof (Type)
#include<iostream>
#include<stdio.h>
#include<math.h>
#include <limits> // 头文件
#include<algorithm>
using namespace std;
int main()
{
cout << "int:" << "所占字节数:" << sizeof(int)<<endl;
cout << "最大值:" << (numeric_limits<int>::max)()<<endl;
cout << "最小值:" << (numeric_limits<int>::min)() << endl;
return 0 ;
}