strcut node* create(int n)
{
int number;
struct node *p,,*q,*head;
p=(struct node*)malloc(sizeof(struct node));
if(p == null)
{
printf("申请失败!\n");
return -1;
}
head=p;
head->next=null;
for(int i=0;i<n;i++)
{
q=(struct node*)malloc(sizeof(struct node));
printf("input a umber:");
scanf("%d",&number);
q->data=number;
p->next=q;
p=q;
}
p->next==null;
return head;
}
{
int number;
struct node *p,,*q,*head;
p=(struct node*)malloc(sizeof(struct node));
if(p == null)
{
printf("申请失败!\n");
return -1;
}
head=p;
head->next=null;
for(int i=0;i<n;i++)
{
q=(struct node*)malloc(sizeof(struct node));
printf("input a umber:");
scanf("%d",&number);
q->data=number;
p->next=q;
p=q;
}
p->next==null;
return head;
}