敲代码 学调试 基本的啊

梅尚程荀
马谭杨奚
程序代码:#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int data;
struct node *next;
};
typedef struct node linklist;
linklist *creast(int n);
void scan(linklist *h);
linklist *delete(linklist *h);
int main(){
int n,i;
linklist *h;
h=(linklist*)malloc(sizeof(struct node));
printf("Please input the n:");
scanf("%d",&n);
h=creast(n);
for(i=0;i<n;i++){
scan(h);
h=delete(h);
}
return 0;
}
linklist *creast(int n){
int i;
linklist *p,*h;
printf("Please input the %d numbers:",n);
h=(linklist*)malloc(sizeof(struct node));
h->next=NULL;
for(i=0;i<n;i++){
p=(linklist*)malloc(sizeof(struct node));
scanf("%d",&p->data);
p->next=h->next;
h->next=p;
}
return h;
}
void scan(linklist *h){
linklist *m;
if(h=NULL) printf("Empty List!\n");
m=(linklist*)malloc(sizeof(struct node));
m=h->next;
while(m){
printf("%d\t",m->data);
m=m->next;
}
}
linklist* delete(linklist *h){
linklist *q;
q=h->next;
h->next=h->next->next;
free(q);
return h;
}我花了一晚上,把程序改成这个样子了,可是还是有错哇