C/C++ Arena

Step 1 of 6

sort and reverse

<algorithm> works on ranges given as a pair of iterators, usually v.begin(), v.end():

std::sort(v.begin(), v.end());       // ascending
std::reverse(v.begin(), v.end());
auto it = std::max_element(v.begin(), v.end());   // iterator to the max

Your turn: sort the scores ascending, then reverse them so the best is first.

Next: Lambdas