#include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> vec = { 7, 3, 5, 1, 9 }; std::sort(vec.rbegin(), vec.rend()); // do anything return 0; }