算法:写一个创建链表的函数,创建好链表再输出。
创建链表:所有结点的输入都放在while循环里面,只要输入N次就可以了,输入了结点再把它连接到链表上。n=0是表头,比较特殊;一个结点,是表尾,也比较特殊,把它们都分开处理。最后输出的时候用p3=p3->next来循环输出
#include<stdio.h>
#include<stdlib.h>
#define N 10
#define LEN sizeof(struct student)
struct student
{
int num;
char name[20];
float score[3];
float sum;
float aver;
struct student*next;
};
typedef struct student list;
list*creat