sorting problem

hi

you have to enter values in the command line and it should print in the screen the highest one.

I has trying to sort a vector and making a return of the last number.
The code has no error but doesn't work right
Last edited on
return valores[n];
Should be return valores.back();

Sorting to get the max element isn't very efficient.
http://www.cplusplus.com/reference/algorithm/max_element/
Topic archived. No new replies allowed.