max of vector function code example
Example 1: max of a vector c++
cout<<*max_element(a.begin(), a.end())<<endl;
Example 2: c++ max and min of vector
template <typename T, size_t N> const T* mybegin(const T (&a)[N]) { return a; }
template <typename T, size_t N> const T* myend (const T (&a)[N]) { return a+N; }