Sort elements in range
Sorts the elements in the range [first,last) into ascending order.
The elements are compared using operator< for the first version, and comp for the second.
Equivalent elements are not guaranteed to keep their original relative order (see stable_sort).

调用sort,引用头文件:#include <algorithm>
调用less(从小到大),greater(从大到小),引用头文件:#include <functional>
同时对于char等类型排序也是可以的。
浙公网安备 33010602011771号