#include<stdio.h>
#define NULL 0
typedef int elemtype;
typedef struct node
{elemtype data;
struct node *next;
}slink;
int n=1;
int m;
slink *creat(void)
{
int i,m;
slink *head,*p,*sq;
sq=(slink*)malloc(sizeof(slink));
sq->next=NULL;
p=sq->next;
printf(“please input the slink longs:\n”);
scanf(“%d”,&m);
if(m==0)
printf(“please input again:\n”);
for(i=1;i<=m;i++)
{
scanf(“%f”,&p->data);
p=p->next;
}
}
Void displist(slink *sq)
{
slink *p=sq->next;
while(p!=null)
Printf(“p->data “);
)
Int Inselem(slink*sq,elemtype x,int i)
{
int j=1;
printf(“please input the locate you want inset\n”)
scanf(“%d”,&i);
printf("please input the number you want inset:\n");
scanf("%f",&x);
slink *p=sq,*s;
s=(slink *)malloc(sizeof(slink));
s->data=x;
s->next=NULL;
if(i<1 || i>m+1)
printf(“your input is wrong!")
return 0;
while(j<i)
{p=p->next;j++;}
s->next=p->next;
p->next=s;
return 1;
}
int Delelem(slink *sq,int i)
{
int j =1;
slink *p=sq,*q;
printf("please input the locate you want delelate:\n");
scanf ("%d",&i);
if(i<1 || i>m)
printf("your enter is wrong!");
return 0;
while (j<i)
{p=p->next;j++;}
q=p->next;
p->next=q->next;
free(q);
return 1;
}
mian()
{
int j ,i;
slink *q,*p;
p=q=(slink*)malloc(sizlf(slink));
q=creat();
Displist(q);
q=insert(q,p);
Displist(q);
Delelem(q,j);
Displist(q);
getch();
}
下划线红色的字是它出现有错误的行.显示的错误是{ Error C:\TC\NONAME.C 27: Declaration syntax error}