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等类型排序也是可以的。
基础-Sort函数
原文:http://www.cnblogs.com/ArronXing/p/4634597.html