[求助]这个程序无法用
大家帮个忙!谢谢!
#define M 4
#define N 7
#define NULL 0
#include<malloc.h>
void main()
{
void unon(int *a,int m,int *b,int n,int *p);
int i,la[M],lb[N];
int *p=NULL;
p=(int *)malloc((M+N)*sizeof(int));
system("cls");
printf("Please input the 4 data of arry A:\n");
for(i=0;i<M;i++)
scanf("%d",la+i);
printf("Please input the 7 data of arry B:\n");
for(i=0;i<N;i++)
scanf("%d",lb+i);
unon(la,M,lb,N,p);
printf("Arry A has %d elemts.\n",M+N);
for(i=0;i<M+N;i++)
printf("%d ",*(p+i));
}
void unon(int *a,int m,int *b,int n,int *p)
{
int *pa=a,*pb=b;
while(pa<=(a+m)&&pb<=(b+n))
{
if(*pa<=*pb) *p++=*pa++;
else *p++=*pb++;
}
while(pa<=(a+m)) *p++=*pa++;
while(pb<=(b+n)) *p++=*pb++;
return ;
}