使用 max 比较多个数字:
1 #include <iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 int a = 0,b = 9,c = 9,d = 7; 8 cout << max( {a,b,c,d} ) << endl; // 参数使用初始化列表方式传入 9 return 0; 10 }
C++的max
原文:https://www.cnblogs.com/limancx/p/13762831.html