求一个简单的C语言的学生成绩管理系统
来源:百度知道 编辑:UC知道 时间:2024/05/31 14:00:09
输入n个学生以及每个学生的数学和英语成绩,然后计算没门课程的总成绩,平均分,最高分和最低分,然后输出新的成绩单
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define LEN sizeof(Student)
typedef struct student
{
int num;
char name[20];
int score[4];
int sum;
struct student *next;
}Student;
int n;
Student *cin(void);
Student *sort_1(Student *head,int);
void sort_2(Student *head);
void print(Student *head);
Student *sort_all(Student *head);
void find(Student *head);
Student *add_new(Student *head);
Student *cin()
{
int flag;
Student *head,*p1,*p2;
n=0;
head=(Student *)malloc(LEN);
p2=head;
printf("\n请输入第%d名学生的学号,学号为0表示结束输入:",n+1);
scanf("%d",&flag);
while(getchar()!='\n');
for(;flag;)
{
n++;
p1=(Student *)malloc(LEN);
p1->num=flag;
printf("请输入第%d名学生的姓名:",n);<