我有个程序不通过 可以帮忙解决吗
#include<stdio.h>#define Max 50
//在数组的指定位置插入1个数并输出
int main()
{
void DeleteList();
void InsetList (int*H,int L );
int List[Max] = {1,2,5,4,8,7,6,7,5,4,2,5};
int i, Num, F=1 ,Len;
int *Head,*End;
Head=End=List;
if (*End )
for(i=1; i<Max; i++)
{
if(*(List+i))
{
End = List+i;
Len = i+1;
}
else
break;
}
else Len=0;
printf( "输出线性表:\n" );
for ( i=0; i<Len; i++ )
printf("%d ",List[i]);
printf("\n");
printf(" 1 插入1个数 \n");
printf(" 2 删除1个数 \n");
while(F)
{
if (scanf("%d",&Num)==1)
{
if (Num ==1 || Num==2)
{
switch (Num)
{
case 1: InsetList(Head,Len);break;
case 2: printf("YES");break;//DeleteList();break;
}
F=0;
}
else
printf ("重新输入:\n"); F=1; fflush(stdin);
}
else
{
printf ("重新输入:\n"); F=1; fflush(stdin);
}
}
getchar();
getchar();
return 0;
}
void InsetList ( int *H, int L )
{
int i;
int Num;
int Place;
printf("%d\n",H);
if (L == Max)
printf("顺序表已满!");
else
{
for ( i=0; i<L; i++ )
printf("%d ",*(H+i));
printf("\n");
printf ("输入要插入的数:\n");
scanf ("%d",&Num);
printf ("输入要插入的位置:\n");
scanf ("%d",&Place);
if (Place>L)
printf ("错误!");
else
{
for(i=L;i>=Place;i--)
{
*(H+i)=*(H+i-1);
}
*(H+Place-1)=Num;
printf("%d\n",H);
for(i=0;i<L+i;i++)
{
printf("%d,",*(H+i));
}
}
}
}