sort a vector in decreasing order c++ code example Example: sort vector in descending order sort(a.begin(), a.end(), greater<int>());