#include #include #include #include int main() { // Sort an integer array int a[] = {20, 7, 5, 10, 18}; std::vector vec (a, a + sizeof(a)/sizeof(int)); std::sort(vec.begin(), vec.end()); // vec [5](5,7,10,18,20) // Sort strings std::vector strs; strs.push_back("hello"); strs.push_back("std::string"); strs.push_back("Hello"); strs.push_back("std::sort"); std::sort(strs.begin(), strs.end()); // [4]("Hello","hello","std::sort","std::string") return 0; }