#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> merge(vector<int> ,vector<int> );
int main()
{
vector<int> v1;
v1.push_back(4);
v1.push_back(6);
v1.push_back(2);
vector<int> v2;
v2.push_back(3);
v2.push_back(1);
v2.push_back(5);
vector<int> v3=merge(v1,v2);
sort(v3.begin(),v3.end());
for(vector<int>::iterator it=v3.begin();it!=v3.end();++it){
cout<<*it<<endl;
}
}
vector<int> merge(vector<int> v1,vector<int> v2)
{
v1.insert(v1.end(),v2.begin(),v2.end());
return v1;
}
-------------------------
建立两个int类型的向量vector,利用merge算法合并,再用sort算法对合并后算法排序(用c++)