文章
70
粉丝
0
获赞
222
访问
6.5k
#include<stdio.h>
#include<malloc.h>
typedef struct Node{
int numb;
struct Node * Next;
}Node;
Node * create_link(int n){
Node * head = (Node*)malloc(sizeof(Node));
head->Next = head;
head->numb = 1;
Node * q = head;
for(int i=2; i<=n; i++){
Node * p = (Node*)malloc(sizeof(Node));
p->Next = head;
p->numb = i;
q->Next = p;
q = q->Next;
}
return head;
}
int search_last(Node * head){
Node * q = head;
int count=1;
while( q->Next!=q ){
count++;
 ...
登录后发布评论
暂无评论,来抢沙发