F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^#include typedef struct lnode{int data;struct lnode *next;}linklist;linklist creat(int n){linklist *head,*p1,*p2;int i;int a;head=NULL;printf("输入数据");for(i=

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 10:23:14

F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^#include typedef struct lnode{int data;struct lnode *next;}linklist;linklist creat(int n){linklist *head,*p1,*p2;int i;int a;head=NULL;printf("输入数据");for(i=
F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^
#include
typedef struct lnode{
int data;
struct lnode *next;
}linklist;
linklist creat(int n){
linklist *head,*p1,*p2;
int i;
int a;
head=NULL;
printf("输入数据");
for(i=0;idata=a;
if(p1=NULL)
head=p1;
else
p2=p1->next;
p1=p2;
}
p1->next=head;
return *head;
}
int main(void)
{
int n;
printf("输入节点数\n");
scanf("%d",&n);
linklist *head,*p;
p=creat();
head=p;
while(p!=head){
printf("%d",p->data);
p=p->next;
}
printf("\n");
return 0;
}

F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^#include typedef struct lnode{int data;struct lnode *next;}linklist;linklist creat(int n){linklist *head,*p1,*p2;int i;int a;head=NULL;printf("输入数据");for(i=
34行 p=creat(); 改成p=creat(n);