#include<iostream>
using namespace std;#include<vector>
class Solution
{
public:voidmerge_array(vector<int>& a,int len_a, vector<int>& b,int len_b){int m = len_a -1;int n = len_b -1;int k = a.size()-1;while(k >=0){if(m <0|| n <0){if(m <0){for(int j =0; j <= k; j++){
a[j]= b[j];}}break;}if(a[m]> b[n]){
a[k]= a[m];
m -=1;}else{
a[k]= b[n];
n -=1;}
k -=1;}}};intmain(int argc,char* argv[]){
vector<int> a ={5,63,74,0,0,0,0};int m =3;
vector<int> b ={6,10,22,33};int n =4;
Solution solution;
solution.merge_array(a, m, b, n);for(vector<int>::iterator iter = a.begin(); iter != a.end(); iter++){
cout <<*iter << endl;}system("pause");return0;}