使用 std::max 函数:
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int a, b, c, d;
std::cin >> a >> b >> c >> d;
int max = std::max({a, b, c, d});
std::cout << max;
return 0;
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号