📄 clinklist.h
字号:
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define OK 1
#define ERROR 0
#define TRUE 1
#define FALSE 0
typedef int ElemType;
typedef struct Node /*结点类型定义*/
{
ElemType data;
struct Node * next;
}Node, *LinkList; /* LinkList为结构指针类型*/
void create_clinklist(LinkList l)/*创建循环链表*/
{
int num;
Node *p;
l->data=-1;
l->next=l;
printf("请输入循环链表的元素 (以-1结束):\n");
scanf("%d",&num);
while(num != -1)
{
p=(Node*)malloc(sizeof(struct Node));
p->data=num;
p->next=l->next;
l->next=p;
scanf("%d",&num);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -