vector 类型赋值 vector<int> v={1,2,3}; //直接赋值 int a[]={1,2,3}; //通过int数组向vector赋值 vector<int> v(a,a+sizeof(a)/sizeof(*a));