//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64
#include
#include
#include
#include
using namespace std;
int main()
{
array, 3> arr2d { { { 5, 4, 0 },
{-3, 5, 7 },
{ 8, 2,-1 } } };
pair maxmin(INT_MAX, 0);
for (const auto& i : arr2d)
{
int curr_min = *min_element(i.cbegin(), i.cend());
int curr_max = *max_element(i.cbegin(), i.cend());
maxmin.first = maxmin.first > curr_min ? curr_min : maxmin.first;
maxmin.second = maxmin.second < curr_max ? curr_max :
maxmin.second;
}
cout << maxmin.first << " " << maxmin.second;<br>}