1.初始化
#include <vector>
vector<int> a;
2.插入数据
a.push_back(6);
a.push_back(11);
a.push_back(13);
a.push_back(4);
a.push_back(1);
a.push_back(7);
a.push_back(5);
a.push_back(9);
3.排序
#include <algorithm>
sort(a.begin(),a.end());
4.遍历
4.1遍历(C++11以下)
for(size_t i=0; i<a.size(); i++){
cout << a[i] << endl;
}