1.一次性给vector赋值多个数据
int a[]={0,1,2,3,4,5,6,7}; vector<int> myVec(a,a+8);
或者:
vector<int> myVec{0,1,2,3,4};