# include<stdio.h>
# include<conio.h>
void main(int argc, char *argv[])
{
FILE *ptf1,*ptf2,*ptf3;
int a,b;
clrscr();
a=b=0;
ptf1=fopen(argv[1],"r");
ptf2=fopen(argv[2],"r");
ptf3=fopen(argv[3],"w");
fscanf(ptf1,"%d",&a);
fscanf(ptf2,"%d",&b);
while(1)
{
if(b==0 || a==0)
break;
if(a<b)
{
fprintf(ptf3,"%d ",a);
fscanf(ptf1,"%2d",&a);
}
if(a>b)
{
fprintf(ptf3,"%d ",b);
fscanf(ptf2,"%2d",&b);
}
if(a==b)
{
fprintf(ptf3,"%d ",a);
fscanf(ptf1,"%2d",&a);
fscanf(ptf2,"%2d",&b);
}
}
if(a==0 & b!=0)
{
while(1)
{
fprintf(ptf3,"%d ",b);
//putw(b,ptf3);//b=getw(ptf2);
fscanf(ptf2,"%2d",&b);
if(b==0)
break;
}
}
if(a!=0 & b==0)
{
while(1)
{
fprintf(ptf3,"%d ",a);
fscanf(ptf1,"%2d",&a);
if(a==0)
break;
}
}
fclose(ptf1);
fclose(ptf2);
fclose(ptf3);
}