#include<iostream>
#include<algorithm>
using namespace std;
void main()
{
int nMax = std::max({1,2,3,4,5,6,7,8,9,10});
cout << nMax << endl;
int nMin = std::min({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
cout << nMin << endl;
system("pause");
}
结果: