#include #include #include #include using namespace std; const void printOut(const vector &vi) { cout << "["; vector::const_iterator iter = vi.begin();; while (iter != vi.end()) { cout << *iter; if (++iter != vi.end()) cout << ", "; } cout << "]" << endl; } int main(int argc, char **argv) { vector vi; vi.push_back(7); vi.push_back(13); vi.push_back(5); vi.push_back(23); vi.push_back(2); cout << "Before sorting:" << endl; cout << " "; printOut(vi); sort(vi.begin(), vi.end()); cout << "After sorting:" << endl; cout << " "; printOut(vi); return EXIT_SUCCESS; }