1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int array1[5]={1,5,9,10,15};
int array2[5]={5,3,11,5,16};
int array3[5]={6,4,14,3,18};
cout << "Max val is: " << max(max(*max_element(array1, array1+5),
*max_element(array2, array2+5)),
*max_element(array3, array3+5));
}
|