![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
#include
<
limits
>
#include < iostream >
#include < Tchar.h >
using namespace std;
int _tmain( int argc,_TCHAR * argv[])
{
cout << " short: " << endl;
cout << " min= " << numeric_limits < short > ::min() << endl;
cout << " max= " << numeric_limits < short > ::max() << endl;
cout << " int: " << endl;
cout << " min= " << numeric_limits < int > ::min() << endl;
cout << " max= " << numeric_limits < int > ::max() << endl;
cout << " double: " << endl;
cout << " min= " << numeric_limits < double > ::min() << endl;
cout << " max= " << numeric_limits < double > ::max() << endl;
cout << " long: " << endl;
cout << " min= " << numeric_limits < long > ::min() << endl;
cout << " max= " << numeric_limits < long > ::max() << endl;
return 0 ;
}
#include < iostream >
#include < Tchar.h >
using namespace std;
int _tmain( int argc,_TCHAR * argv[])
{
cout << " short: " << endl;
cout << " min= " << numeric_limits < short > ::min() << endl;
cout << " max= " << numeric_limits < short > ::max() << endl;
cout << " int: " << endl;
cout << " min= " << numeric_limits < int > ::min() << endl;
cout << " max= " << numeric_limits < int > ::max() << endl;
cout << " double: " << endl;
cout << " min= " << numeric_limits < double > ::min() << endl;
cout << " max= " << numeric_limits < double > ::max() << endl;
cout << " long: " << endl;
cout << " min= " << numeric_limits < long > ::min() << endl;
cout << " max= " << numeric_limits < long > ::max() << endl;
return 0 ;
}
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
#include
<
limits
>
#include < iostream >
using namespace std;
int main( void )
{
cout << " short: " << endl;
cout << " min= " << numeric_limits < short > ::min() << endl;
cout << " max= " << numeric_limits < short > ::max() << endl;
cout << " int: " << endl;
cout << " min= " << numeric_limits < int > ::min() << endl;
cout << " max= " << numeric_limits < int > ::max() << endl;
cout << " double: " << endl;
cout << " min= " << numeric_limits < double > ::min() << endl;
cout << " max= " << numeric_limits < double > ::max() << endl;
cout << " long: " << endl;
cout << " min= " << numeric_limits < long > ::min() << endl;
cout << " max= " << numeric_limits < long > ::max() << endl;
return 0 ;
}
#include < iostream >
using namespace std;
int main( void )
{
cout << " short: " << endl;
cout << " min= " << numeric_limits < short > ::min() << endl;
cout << " max= " << numeric_limits < short > ::max() << endl;
cout << " int: " << endl;
cout << " min= " << numeric_limits < int > ::min() << endl;
cout << " max= " << numeric_limits < int > ::max() << endl;
cout << " double: " << endl;
cout << " min= " << numeric_limits < double > ::min() << endl;
cout << " max= " << numeric_limits < double > ::max() << endl;
cout << " long: " << endl;
cout << " min= " << numeric_limits < long > ::min() << endl;
cout << " max= " << numeric_limits < long > ::max() << endl;
return 0 ;
}
代码有所不同 主要是在linux中涉及到了wchar和tchar的问题 暂时未涉及,以后来完善。