c语言程序错误求大神改错
#include<stdio.h>
#include<stdlib.h>
typedef struct
{
int data[100];
int length;
}sequenlist;
int main()
{
void creat(sequenlist *L);
void show(sequenlist *L);
void find(sequenlist *L);
void insert(sequenlist *L);
void Delete(sequenlist *L);
void sort(sequenlist *L);
void inversed(sequenlist *L);
sequenlist *L,a;
L=&a;
creat(L);
show(L);
find(L);
insert(L);
show(L);
Delete(L);
show(L);
sort(L);
show(L);
inversed(L);
show(L);
return 0;
}
void creat(sequenlist *L)
{
printf("Input the lenght of the list L:\n");
int j=0;
scanf("%d",&L->length);
printf("Input the contennt:\n");
for(j;j<L->length;j++)
scanf("%d",&L->data[j]);
}
void show(sequenlist *L)
{
int j=0;
printf("Output the list and its length:\n");
for(j;j<L->length;j++)
printf("%d",L->data[j]);
printf("\n");
printf("the lenght is %d\n",L->length);
printf("\n");
}
void find(sequenlist *L,int n)
{
int a,m,j;
printf("please enter the number you want to find:\n");
scanf("%d",&a);
m=0;
for(j=0;j<L->length;j++)
{if(L->data[j]==a)
{printf("the number is %d\n",L->data[j]);
printf("it's the %d number\n",m);}
else
m=m+1;
}
}
void insert(sequenlist *L)
{
int i,j,e;
printf("please enter the place you want to insert:\n");
scanf("%d",&i);
printf("please enter the number:\n");
scanf("%d",&e);
if((i<1)||(i>L->length+1))
printf("error\n");
j=L->length;
if(j;j>i-1;j--)
L->data[j+1]=L->data[j];
L->data[i-1]=e;
++L->length;
}
error C2143: syntax error : missing ')' before ';'
(75) : warning C4390: ';' : empty controlled statement found; is this the intent?
(75) : warning C4552: '>' : operator has no effect; expected operator with side-effect
(75) : error C2059: syntax error : ')'
(76) : error C2146: syntax error : missing ';' before identifier 'L'
执行 cl.exe 时出错.
1.obj - 1 error(s), 0 warning(s)