#include <iostream>
#include <string>
#include <algorithm>
int main()
{
const int count = 5;
std::string scores[count] = { "35","25","3","4","5" };
// TWEAKED SORT
std::sort(scores, scores + count, [](std::string const &s1, std::string const &s2)
{
return std::stoi(s2) < std::stoi(s1);
});
// TEST
for (auto const &s : scores)
{
std::cout << s << std::endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKaW50IG1haW4oKQp7CiAgICBjb25zdCBpbnQgY291bnQgPSA1OwogICAgc3RkOjpzdHJpbmcgc2NvcmVzW2NvdW50XSA9IHsgIjM1IiwiMjUiLCIzIiwiNCIsIjUiIH07CgogICAgLy8gVFdFQUtFRCBTT1JUCiAgICBzdGQ6OnNvcnQoc2NvcmVzLCBzY29yZXMgKyBjb3VudCwgW10oc3RkOjpzdHJpbmcgY29uc3QgJnMxLCBzdGQ6OnN0cmluZyBjb25zdCAmczIpCiAgICB7CiAgICAgICAgcmV0dXJuIHN0ZDo6c3RvaShzMikgPCBzdGQ6OnN0b2koczEpOwogICAgfSk7CgogICAgLy8gVEVTVAogICAgZm9yIChhdXRvIGNvbnN0ICZzIDogc2NvcmVzKQogICAgewogICAgICAgIHN0ZDo6Y291dCA8PCBzIDw8IHN0ZDo6ZW5kbDsKICAgIH0KfQ==