#include <stdio.h>
#include <stdlib.h>
struct Student//学生结构体
{
char* name;
int chinese;
int math;
int english;
int sum;
struct Student* next;
};
struct Class//班级结构体
{
char* class;
struct Student* stuhead;
struct Class* next;
};
struct Class* Chead=NULL;//宏定义班级头部
struct Class* insertClassBehind(struct Class* new)//尾插入法班级
{
struct Class*p = Chead;
if(p == NULL){
Chead = new;
return Chead;
}
while(p->next != NULL){
p = p->next;
}
p->next = new;
return Chead;
}
struct Student* insertStudentBehind(struct Student* stuhead, struct Student* new)//尾插入法学生
{
struct Student *p = stuhead;
if(p == NULL){
stuhead = new;
return stuhead;
}
while(p->next != NULL){
p = p->next;
场景:一个年级,相当链表A ,该年级5个班,每个班5个人,相当于链表B1--B5:做一个学生成绩管理系统学生成绩有语文 数学 英语功能: 录入成绩 找三科总分的最高分 最低分 算出平均分
于 2023-01-10 10:16:44 首次发布