
import java.io.*;
class ranveer
{
public static void main(String args[])throws IOException
{
BufferedReader in =new BufferedReader(new InputStreamReader(System.in));
int m=Integer.parseInt(in.readLine());
int n=Integer.parseInt(in.readLine());
int a[]=new int [m];
int b[]=new int [n];
int c[]=new int [m+n];
for (int i=0;i<m;i++)
{
a[i]=Integer.parseInt(in.readLine());
}
for (int j=0;j>n;j++)
{
b[j]=Integer.parseInt(in.readLine());
}
for( ;i<m && j<n; )
{
if (a[i]< b[j])
{
c[k]=a[j];
j++;
k++;
}
else if (b[j]<a[i])
{
c[k]=b[j];
j++;
k++;
}
else if (a[i]==b[j])
{
c[k]=a[i];
k++;
i++;
c[k]=b[j];
k++;
j++;
}
}
for ( ;i<m; i++)
{
c[k]=a[i];
k++;
i++;
}
for ( ;j<n;j++)
{
c[k]=b[j];
k++;
j++;
}
for (p=0;p<k;p++)
{
System.out.println(c[p]);
}
}
}

Hi,
What do you want to do with this code. Please clarify this.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.