链表成绩排序

来源:百度知道 编辑:UC知道 时间:2024/06/04 17:28:50
题目如下:
1. 编写程序实现以下功能
(1) 创建一单链表,包含10个学生的学号、姓名以及3门课的成绩;
(2) 输出每门课的平均分,以及低于平均分学生的数量;
(3) 按学生总分进行排序(降序);
(4) 实现查找功能,如输入某一学生的学号,要求输出其相关信息,如果没有该学生信息,则输出提示信息“没有找到”;
(5) 实现添加学生信息的功能;

急!!!啊,今天能给我答案吗??

呵呵,这是我第一次用链表写,以你要求的功能,程序如下,有点长~
-------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
struct Student
{
long number;
char name[10];
float score[3];
float sum;
struct Student *next;
};
char Menu(void);
struct Student *App(struct Student *head);
void Ave(struct Student *head);
void Ser(struct Student *head);
void Pri(struct Student *head);
void Fre(struct Student *head);
int main(void)
{
struct Student *head=NULL;
while(1)
{
switch(Menu())
{
case '1':
printf("请入学生信息,直接输入'-1'结束\n");
head=App(head);
break;
case '2':
Ave(head);
break;
case '3':
Ser(head);
break;
case '4':
printf("学生信息如下:\n");
Pri(head);