文章
9
粉丝
0
获赞
55
访问
1.4k
#include<stdio.h>
struct child{
int val;
struct child *next;
};
int main()
{
int N;
scanf("%d",&N);
struct child *head=(struct child*)malloc(sizeof(struct child));
struct child *q;
head->next=NULL;
q=head;
for(int i=1;i<=N;i++)
{
struct child *fp=(struct child*)malloc(sizeof(struct child));
fp->val=i;
fp->next=NULL;
q->next=fp;
q=fp;
}
q->next=head->next;
struct child *p;
p=head->next;
int count=0;
while(N>1)
&nbs...
登录后发布评论
暂无评论,来抢沙发