std::vector max code example Example: max of a vector c++ cout<<*max_element(a.begin(), a.end())<<endl;