vector<int> v1; vector<int> v2; for(int i=0; i<5; i++) { v1.push_back(i); if(i%2==1) { v2.push_back(i*10); } } print(v1,"v1"); print(v2,"v2"); vector<int> v3; v3.insert(v3.end(),v1.begin(),v1.end()); v3.insert(v3.end(),v2.begin(),v2.end()); print(v3,"v3");
void HelloWorld::print(vector<int>& v,const char* mark) { cout<<"------------ "<<mark<<" ------------"<<endl; size_t len = v.size(); for (size_t i = 0; i < len; i++) { cout<<v[i]<<endl; } }