题解 | 最大最小值
最大最小值
https://www.nowcoder.com/practice/051cbca4504d40f5b20bb891d83ec408
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << "The maximum number is : " << max({a, b, c}) << "\n";
cout << "The minimum number is : " << min({a, b, c}) << "\n";
}
algorithm
最大值函数可以用 max(a, b),也可以多个参数 max({a, b, c, d});
最小值函数同理
查看1道真题和解析