程序如下,提示第三行错了。
#define MAXSIZE 20
typedef strcut
{ int data [MAXSIZE];
int last;
}SeqList;
SeqList *init_SeqList()
{SeqList *L;
L=(SeqList*)malloc(sizeof(SeqList));
L->last=-1;
return L;
}
void Order_Insert(SeqList *L,int x)
{ int i,j;
i=L->last;
while(x<L->data[i])
{ L->data[i+1]=L->data[i];
i--;
}
L->data[i+1]=x;
L->last++;
}
main()
{ int i,x;
SeqList *H;
i=0;
H=init_SeqList();
printf("please input a Order SeqList:\n");
scanf("%d",&x);
while(x!=0)
{H->data[i]=x;
i++;
H->last++;
scanf("%d",&x);
}
printf("please iuput the value of insert:\n");
scanf("%d",&x);
Order_Insert(H,x);
printf("Output SeqList after Insert:\n");
for(i=0;i<=H->last;i++)
printf("%3d",H->data[i]);
printf("\n");
}
#define MAXSIZE 20
typedef strcut
{ int data [MAXSIZE];
int last;
}SeqList;
SeqList *init_SeqList()
{SeqList *L;
L=(SeqList*)malloc(sizeof(SeqList));
L->last=-1;
return L;
}
void Order_Insert(SeqList *L,int x)
{ int i,j;
i=L->last;
while(x<L->data[i])
{ L->data[i+1]=L->data[i];
i--;
}
L->data[i+1]=x;
L->last++;
}
main()
{ int i,x;
SeqList *H;
i=0;
H=init_SeqList();
printf("please input a Order SeqList:\n");
scanf("%d",&x);
while(x!=0)
{H->data[i]=x;
i++;
H->last++;
scanf("%d",&x);
}
printf("please iuput the value of insert:\n");
scanf("%d",&x);
Order_Insert(H,x);
printf("Output SeqList after Insert:\n");
for(i=0;i<=H->last;i++)
printf("%3d",H->data[i]);
printf("\n");
}