📄 5-2.c
字号:
#include <stdio.h>
#define N 10
typedef char datatype;
typedef struct node{
datatype data;
struct node *next;
} listnode;
typedef listnode *linklist;
listnode *p;
linklist createlist(int n)
{
int i;
linklist head;
listnode *p;
head=NULL;
for(i=n;i>0;--i)/*指定长度为n,插入次数受限制*/
{
p=(listnode*)malloc(sizeof(listnode));
scanf("%d",&p->data);
p->next=head;
head=p;
}
return(head);
}
main()
{
linklist newlist=createlist(N);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -