Struct node
{
Int data;
Struct node *next;
};
Struct node *createlist(struct node *l,int n)
{
Int i;
Int x;
Struct node *p,*q;
L=(struct node *)malloc(sizeof(struct node))
L->data=n;
L->next=NULL;
Q=l;
For(i=n;i>0;i--)
{
P=(struct node *)malloc(sizeof(struct node));
Scanf(“%d”,&x);
P->data=x;
Q->next=p;
P->next=NULL;
Q=p;
}
Return l;
}
这是单链表的建立子函数,求哪位学长学姐帮我写下主函数。下午就要补考了!!!