- 0
- 0
- 约1.62千字
- 约 2页
- 2024-12-13 发布于湖北
- 举报
#includestdio.h
#includemalloc.h
#defineLENsizeof(structPeople)
structPeople
{
intnum;
charname[20];
charteam[20];
charnation[20];
floatscore[7];
doubleaver;
structPeople*next;
};
intn;//n为全局变量,本文件模块中个函数均可使用它
structPeople*creat(void)//定义函数。此函数返回一个指向链表头的指针
{
structPeople*head;
structPeople*p1,*p2;
inti;
n=0;
head=NULL;
while(n10)
{
n=n+1;
p1=(structPeople*)malloc(LEN);//开辟一个新单元
scanf(%d%s%s%s,p1-num,p1-name,p1-team,p1-nation);
for(i
原创力文档

文档评论(0)