代码
std::vector<int> vec;
std::vector<int> vec1;
std::vector<int> vec2;
vec1.push_back(1);
vec1.push_back(3);
vec1.push_back(5);
vec2.push_back(2);
vec2.push_back(4);
vec2.push_back(6);
vec.resize(6);
std::merge(vec1.begin(), vec1.end(), vec2.begin(), vec2.end(), vec.begin());
std::vector<int> vec1;
std::vector<int> vec2;
vec1.push_back(1);
vec1.push_back(3);
vec1.push_back(5);
vec2.push_back(2);
vec2.push_back(4);
vec2.push_back(6);
vec.resize(6);
std::merge(vec1.begin(), vec1.end(), vec2.begin(), vec2.end(), vec.begin());