#include<stdio.h>
#include<stdlib.h> //malloc函数需要的头文件
#include<assert.h> //宏assert需要的头文件
struct student
{
int xh;
char name[10];
int english;
int computer;
};
typedef struct _lnode
{
struct student data; //数据元素
struct _lnode *next; //指向后继节点的指针
}Lnode;
Lnode *list_create(Lnode *first,struct student a[],int n);
Lnode *list_insert(Lnode *first,Lnode *p,struct student e);
Lnode *list_insert1(Lnode *first,struct student t);
void list_print(Lnode *first);
void list_destroy(Lnode *first);
void list_all(Lnode *first);
Lnode *list_delect(Lnode **first,int h);
Lnode *list_find(Lnode *first,int n);
Lnode *list_sort_select0(Lnode *first);
Lnode *list_sort_select1(Lnode *first);
void main()
{
struct student a[]={{4,"wang",60,90},{3,"liwei",80,88},{2,"kitty",97,94},{1,"jim",99,80}};
struct student t;
Lnode *first=0,*p=0,*k=0;
first=list_create(first,a,4);
int i,sum=0;
while(i)
{
printf("1:all of the score!:\n");
printf("2:sort through english!\n");
printf("3:sort through computer!\n");
printf("4:insert!\n");
printf("5:delect!\n");
printf("6:search!\n");
printf("7:the aver student!\n");
printf("0:quit!\n");
scanf("%d",&i);
switch(i)
{
case 1:
printf("all of the score!\n");
list_print(first);
break;//输出第1行,链表的原始数据
case 2:
printf("sort through the english!\n");
first=list_sort_select0(first);
list_print(first);
break;//用eng成绩排序!
case 3:
printf("sort through the computer!\n");
first=list_sort_select1(first);