#include <algorithm>
#include <iostream>

int main() {
	using namespace std;
	
	int i[] = { 1, 84, 11, 31 };
    cout << *std::max_element(i, i + (sizeof(i) / sizeof(*i))) << endl; // for C++03 or earlier
    
    // C++11 and later:
    cout << *std::max_element(std::begin(i), std::end(i)) << endl;
    auto i2 = { 1, 84, 11, 31 };
    cout << std::max(i2) << endl;
    cout << std::max({ 1, 84, 11, 31 }) << endl;
}