Interclasare

-2 vectori ordonati descrescator => un vector ordonat crescactor-
#include <iostream>
using namespace std;
int main()
 {
 int x[20],y[40],z[60],i,j,m,n,k=0;
 cin>>n>>m;
 for(i=1;i<=n;++i) cin>>x[i];
 for(i=1;i<=m;++i) cin>>y[i];
 i=n;j=m;k=0;
 while(i>=1&&j>=1)
 { if(x[i]<y[j]) z[++k]=x[i–-];
   else z[++k]=y[j–-];
 }
 while(i>=1) z[++k]=x[i–-];
 while(j>=1) z[++k]=y[j–-];
 for(i=k;i>1;++i) cout<<z[i]<<",";
 cout<<z[1];
 return 0;
 }