C语言程序设计大作业
编写程序,实现单链表的插入、删除、输出、查找、统计以及销毁功能。
单链表的每个结点存储一名学生的信息,包括:学号、姓名、性别、年龄、三门课程(高数、英语、C语言)的成绩、三门功课的平均分。
结构体类型声明如下: typedef struct student {
char sno[8];
char name[20];
char sex;
int age; double score[3]; double avg;
struct student *next; } STUDENT, *PSTUDENT;
要求:
⑴一律使用 STUDENT 声明学生结构体的变量,一律使用 PSTUDENT 声明指向学生结构体的指针变量
⑵程序运行过程中要有菜单提示,菜单如下:
*************************************************************** *
1.Insert a student
* *
2.Delete a student
* *
3.Display the link list
* *
4.Display excellent students
* *
5.Search a student by the name
* *
6.Display the average score of three courses * *
0.Exit the program
* ***************************************************************
“Insert a student”:插入一个学生记录,要求按平均分从高到低插入 “Delete a student”:删除指定学号的学生 “Display the link list”:输出单链表中所有学生的信息 “Display excellent students”:输出链表中三门功课平均成绩高于85分(含85分)的学生信息 “Search a student by the name”:根据输入的姓名,输出链表中相应学生的信息 “Display the average score of three courses”:输出链表中所有学生的高数平均分、英语平均分以及C语言平均分 “Exit the program”:销毁单链表,结束程序运行