#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std; vector<int> a;
vector<int> b[]; int main()
{
a.push_back();
a.push_back();
cout<<a[]<<" "<<a[]<<endl;
cout<<a.front()<<" "<<a.back()<<endl; a.push_back();
sort(a.begin(),a.end()); for (int i=;i<a.size();i++)
cout<<a[i]<<" ";
cout<<endl; a.pop_back();
cout<<a[]; a.empty(); //vector是否为空
a.clear(); //清空vector return ;
}
发现一个大佬写的Vector一些更骚的用法:https://www.cnblogs.com/zwfymqz/p/7788554.html