学生成绩管理

68 阅读26分钟

学生成绩管理系统

一、任务书

(一)学校现状分析

1.某学校有本科生和研究生两类学生,学生信息包括基本资料数据和成绩数据两部分。

A.本科生:基本资料数据包括学号、姓名、性别、专业、班级,学号自动生成,其他全部是输入项;成绩数据包括高数成绩、英语成绩、C语言成绩、总成绩、班级排名、校级排名,其中:高数成绩、英语成绩、C语言成绩为输入项,总成绩、班级排名、校级排名是计算项,班级排名是总成绩在班内的名次,校级排名是总成绩在校内的名次。

B.研究生:基本资料数据包括学号、姓名、性别、专业、班级、研究方向、导师,学号自动生成,其他全部是输入项;成绩数据包括课程综合成绩、论文成绩、总成绩、班级排名、校级排名,其中:课程综合成绩、论文成绩为输入项,总成绩、班级排名、校级排名是计算项,班级排名是总成绩在班内的名次,校级排名是总成绩在校内的名次。

2、现在需要开发一个学生成绩管理系统对学生成绩进行有效管理。

(二)系统的功能要求

1、数据维护管理:要求对学生的基本资料数据和成绩数据分开管理。基本资料数据的维护管理功能包括添加(批量、单个)、修改、删除、查询等;成绩数据的维护管理功能包括输入(批量、单个)、修改、删除、查询等。

A. 基本资料数据的维护管理

(1).添加:(批量、单个)添加学生基本资料数据。本科生的基本资料数据包括学号、姓名、性别、专业、班级,学号自动生成,其他全部是输入项。研究生的基本资料数据包括学号、姓名、性别、专业、班级、研究方向、导师,学号自动生成,其他全部是输入项

(2).修改:根据学号来修改任意学生的除学号外的其他基本资料数据。

(3).删除:根据学号删除一个学生。

(4).查询:根据学号查询一个学生的基本资料数据。

B. 成绩数据的维护管理

(1).输入:(批量、单个)输入学生成绩数据。成绩数据根据学生类型的不同而有区别,输入的相关数据也应不同。注意:总成绩、班级排名、校级排名是计算项,不能输入。

(2).修改:根据学号来修改任意学生的相关成绩数据(注意:不同类别学生相关数据不同)。

(3).删除:根据学号删除一个学生(不能删除,只需将相关数据项设置成-1)。

(4).查询:根据学号查询一个学生的成绩数据。

(5).计算:批量计算所有学生的总成绩、班级排名、校级排名。注意,只有各项数据都为有效数据时(-1为无效数据),才能计算。

2.排名功能

A:班级排名:分本科生和研究生两类学生,计算每个学生总成绩在班级中的名次。

B:校级排名:分本科生和研究生两类学生,计算每个学生总成绩在全校中的名次。

说明:排名规则按体育竞赛规则,若出现两个并列第1名,下个名次为第3名,依此类推。

3.排序功能:分本科生和研究生两类人员,实现下列排序功能。

  1. 所有学生信息按总成绩从高到低排序并显示。

  2. 某个班学生信息按总成绩从高到低排序并显示。

    4.查询功能:分本科生和研究生两类人员,实现下列查询功能。

  1. 分页显示全部学生的信息。分页功能:每页显示10条学生的信息,有上一页、下一页、首页和最后一页的功能。

  2. 能够按班级显示本班全部学生信息。注意:无需分页显示。

  3. 能够根据学号或者姓名查询学生信息。

  4. 能够在某个班级中查询某门课成绩不及格学生信息。注意:无需分页显示。

  1. 统计功能:分本科生和研究生两类人员,实现下列统计功能。
  1. 统计并显示某门课每个班的平均成绩。如果学生该门课没有成绩,则统计时忽略该生。

  2. 在某个班中统计并显示某门课程不同等级的学生人数。等级标准:优—成绩大于等于90;良—成绩大于等于80且小于90;中:成绩大于等于70且小于80;及格:成绩大于等于60且小于70;不及格:成绩小于60。

(三)系统的实现技术要求

  1. 学生用结构体表示,本科生和研究生分别用两个链表来存储表示。

  2. 必须用文件来存储学生信息。

A.建立本科生和研究生两个文件,分别存放两类学生的信息。

B. 开始运行程序时,从文件中读取学生信息链入到两个不同的链表。

C. 退出程序时将学生信息保存到不同的文件。

D. 主菜单有一个菜单项能够将学生信息保存到文件。

  1. 数据约束:
  1. 学号:整型、不能重复、从1开始依次递增、由软件自动计算产生,不能修改。

  2. 性别:男和女,必须使用枚举类型。

  3. 各种成绩:整型,取值范围为0-100。-1表示未有此项成绩。

  4. 其他:至少有两层菜单。

二、各个部分代码实现

1、创建学生结构体

// 定义学生信息结构体
typedef struct student {
	// 基本信息
	int id; 						// 学号
	char name[30]; 					// 姓名
	enum { MALE, FEMALE } gender; 	// 性别
	char major[30]; 				// 专业
	char Class[30]; 				// 班级
	char research_field[30]; 		// 研究方向
	char mentor[30]; 				// 导师姓名
	// 成绩数据
	int math_score; 				// 高数成绩
	int english_score; 				// 英语成绩
	int Cprogram_score; 			// C语言成绩
	int compre_course_score;		//课程综合成绩
	int dissertation_score;			//论文成绩
	int total; 						// 总成绩
	int rank_in_class;				// 班级排名
	int rank_in_school; 			// 校级排名
} Student;
// 定义链表结构体用于管理学生信息
typedef struct node {
	Student data;
	struct node *next;
} stu_List;


2、各部分功能实现

  • 数据维护管理
/**********基本数据维护管理函数************/

// 添加学生信息
void add_student() {
	int d;
	stu_List *p = (stu_List *)malloc(sizeof(stu_List));
	printf("学生类型(0为本科生,1为研究生):");
	scanf("%d", &d);
	printf("姓名:");
	scanf("%s", p->data.name);
	printf("性别(0为男,1为女):");
	scanf("%d", &p->data.gender);
	printf("专业:");
	scanf("%s", p->data.major);
	printf("班级:");
	scanf("%s", p->data.Class);
	if (d != 0) {
		printf("导师:");
		scanf("%s", p->data.mentor);
		printf("研究方向:");
		scanf("%s", p->data.research_field);
	}
	p->data.id = maxid++;
	p->next = NULL;
	if (d == 0) {
		if (L1 == NULL) {
			L1 = p;
		} else {
			stu_List *p1 = L1;
			while (p1->next != NULL) {
				p1 = p1->next;
			}
			p1->next = p;
		}
	} else {
		if (L2 == NULL) {
			L2 = p;
		} else {
			stu_List *p1 = L2;
			while (p1->next != NULL) {
				p1 = p1->next;
			}
			p1->next = p;
		}
	}
	system("pause");
	system("cls");
}

// 修改学生基本信息
void modify_basic_data() {
	int x;
	printf("请输入要修改学生的学号:");
	scanf("%d", &x);
	stu_List *p = L1, *q = L2;
	int flag = 0;
	while (p != NULL && p->data.id != x) {
		p = p->next;
	}
	if (p != NULL) {
		flag = 1;
		printf("请输入要修改学生基本数据:\n");
		printf("姓名:");
		scanf("%s", p->data.name);
		printf("性别(0为男,1为女):");
		scanf("%d", &p->data.gender);
		printf("专业:");
		scanf("%s", p->data.major);
		printf("班级:");
		scanf("%s", p->data.Class);
		printf("修改成功!\n");
	}
	if (flag == 0) {
		while (q != NULL && q->data.id != x) {
			q = q->next;
		}
		if (q != NULL) {
			printf("请输入要修改学生基本数据:\n");
			printf("姓名:");
			scanf("%s", q->data.name);
			printf("性别(0为男,1为女):");
			scanf("%d", &q->data.gender);
			printf("专业:");
			scanf("%s", q->data.major);
			printf("班级:");
			scanf("%s", q->data.Class);
			printf("导师:");
			scanf("%s", q->data.mentor);
			printf("研究方向:");
			scanf("%s", q->data.research_field);
			printf("修改成功!\n");
		}
	}
	if (p == NULL && q == NULL) {
		printf("查无此人!\n");
	}
	system("pause");
	system("cls");
}

//删除学生
void delete_student() {
	int x;
	printf("请输入要删除学生的学号:");
	scanf("%d", &x);
	stu_List *p = L1, *q = L2;
	int flag = 0;
	while (p->next != NULL && p->next->data.id != x) {
		p = p->next;
	}
	if (p->next != NULL) {
		flag = 1;
		stu_List *tem = p->next;
		p->next = tem->next;
		free(tem);
		printf("删除成功!\n");
	}
	if (flag == 0) {
		while (q->next != NULL && q->next->data.id != x) {
			q = q->next;
		}
		if (q->next != NULL) {
			stu_List *tem = q->next;
			q->next = tem->next;
			tem->next = NULL;
			free(tem);
			printf("删除成功!\n");
		}
	}
	if (p == NULL && q == NULL) {
		printf("查无此人!\n");
	}
	system("pause");
	system("cls");
}

//查找学生信息
void search_student() {
	printf("请输入要查找学生学号:");
	int id;
	scanf("%d", &id);
	stu_List *p = L1, *q = L2;
	int flag = 0;
	while (p != NULL && p->data.id != id) {
		p = p->next;
	}
	if (p != NULL) {
		flag = 1;
		printf("姓名:%s\n学号:%d\n性别:%s\n专业:%s\n班级:%s\n",
		       p->data.name,
		       p->data.id,
		       p->data.gender == MALE ? "男" : "女",
		       p->data.major,
		       p->data.Class);
	}
	if (flag == 0) {
		while (q != NULL && q->data.id != id) {
			q = q->next;
		}
		if (q != NULL) {
			printf("姓名:%s\n学号:%d\n性别:%s\n专业:%s\n班级:%s\n导师:%s\n研究方向:%s\n",
			       q->data.name,
			       q->data.id,
			       q->data.gender == MALE ? "男" : "女",
			       q->data.major,
			       q->data.Class,
			       q->data.mentor,
			       q->data.research_field);
		}
	}
	if (p == NULL && q == NULL) {
		printf("查无此人!\n");
	}
	system("pause");
	system("cls");
}


/************成绩数据维护管理************/
//添加修改删除学生成绩函数是同一个
void add_student_score() {
	int x;
	printf("请输入要添加成绩学生的学号:");
	scanf("%d", &x);
	stu_List *p = L1, *q = L2;
	int flag = 0;
	while (p != NULL && p->data.id != x) {
		p = p->next;
	}
	if (p != NULL) {
		flag = 1;
		printf("请输入学生成绩:\n");
		printf("高数成绩:");
		scanf("%d", &p->data.math_score);
		printf("C语言成绩:");
		scanf("%d", &p->data.Cprogram_score);
		printf("英语成绩:");
		scanf("%d", &p->data.english_score);
		printf("添加成功!\n");
	}
	if (flag == 0) {
		while (q != NULL && q->data.id != x) {
			q = q->next;
		}
		if (q != NULL) {
			printf("请输入学生成绩:\n");
			printf("课程综合成绩:");
			scanf("%d", &q->data.compre_course_score);
			printf("论文成绩:");
			scanf("%d", &q->data.dissertation_score);
			printf("添加成功!\n");
		}
	}
	if (p == NULL && q == NULL) {
		printf("查无此人!\n");
	}
	system("pause");
	system("cls");
}

//查询学生成绩

void search_score() {
	int x;
	printf("请输入要查询学生的学号:");
	scanf("%d", &x);
	stu_List *p = L1, *q = L2;
	int flag = 0;
	while (p != NULL && p->data.id != x) {
		p = p->next;
	}
	if (p != NULL) {
		flag = 1;
		printf("高数:%d\n", p->data.math_score);
		printf("C语言:%d\n", p->data.Cprogram_score);
		printf("英语:%d\n", p->data.english_score);
		printf("总成绩:%d\n", p->data.total);
		printf("班级排名:%d\n", p->data.rank_in_class);
		printf("校级排名:%d\n", p->data.rank_in_school);
	}
	if (flag == 0) {
		while (q != NULL && q->data.id != x) {
			q = q->next;
		}
		if (q != NULL) {
			printf("课程综合成绩:%d\n", q->data.compre_course_score);
			printf("论文成绩:%d\n", q->data.dissertation_score);
			printf("总成绩:%d\n", q->data.total);
			printf("班级排名:%d\n", q->data.rank_in_class);
			printf("校级排名:%d\n", q->data.rank_in_school);
		}
	}
	if (p == NULL && q == NULL) {
		printf("查无此人!\n");
	}
	system("pause");
	system("cls");
}

//计算总成绩
void calculate_score() {
	stu_List *p = L1, *q = L2;
	while (p != NULL) {
		p->data.total = 0;
		if (p->data.math_score != -1)
			p->data.total += p->data.math_score;
		if (p->data.english_score != -1)
			p->data.total += p->data.english_score;
		if (p->data.Cprogram_score != -1)
			p->data.total += p->data.Cprogram_score;
		p = p->next;
	}
	while (q != NULL) {
		q->data.total = 0;
		if (q->data.compre_course_score != -1)
			q->data.total += q->data.compre_course_score;
		if (q->data.dissertation_score != -1)
			q->data.total += q->data.dissertation_score;
		q = q->next;
	}
}

  • 排序功能
/************* 排名函数***********/
void classify_class(stu_List *classMap1[], stu_List *classMap2[]) {
	// 遍历链表,按照班级分组
	stu_List *current1 = L1, *current2 = L2;
	while (current1 != NULL) {
		int classID = current1->data.Class[0] - '0';
		// 检查该班级是否在哈希表中
		if (classMap1[classID] == NULL) {
			// 如果班级不在哈希表中,创建一个新节点作为头节点
			stu_List *p = (stu_List *)malloc(sizeof(stu_List));
			p->data = current1->data;
			p->next = NULL;
			classMap1[classID] = p;
		} else {
			// 如果班级已存在,将当前学生插入到链表末尾
			stu_List *p = (stu_List *)malloc(sizeof(stu_List));
			p->data = current1->data;
			p->next = NULL;
			stu_List *tail = classMap1[classID];
			while (tail->next != NULL) {
				tail = tail->next;
			}
			tail->next = p;
		}
		current1 = current1->next;
	}
	while (current2 != NULL) {
		int classID = current2->data.Class[0] - '0';
		// 检查该班级是否在哈希表中
		if (classMap2[classID] == NULL) {
			// 如果班级不在哈希表中,创建一个新节点作为头节点
			stu_List *p = (stu_List *)malloc(sizeof(stu_List));
			p->data = current2->data;
			p->next = NULL;
			classMap2[classID] = p;
		} else {
			// 如果班级已存在,将当前学生插入到链表末尾
			stu_List *p = (stu_List *)malloc(sizeof(stu_List));
			p->data = current2->data;
			p->next = NULL;
			stu_List *tail = classMap2[classID];
			while (tail->next != NULL) {
				tail = tail->next;
			}
			tail->next = p;
		}
		current2 = current2->next;
	}
}
// 计算排名

// 分组并对每个班级学生进行排名
void rank_Class(stu_List *classMap1[],stu_List *classMap2[]) {
	// 使用哈希表,键为班级,值为链表头节点指针
	classify_class(classMap1, classMap2);
	// 对每个班级的学生列表进行排序和排名
	for (int i = 1; i < Class_number; i++) {
		if (classMap1[i] != NULL) {
			// 对该班级的学生列表进行排序
			stu_List *curr = classMap1[i];
			while (curr != NULL) {
				stu_List *s = curr;
				stu_List *p = curr->next;
				while (p != NULL) {
					if (s->data.total < p->data.total) {
						s = p;
					}
					p = p->next;
				}
				// 交换节点数据
				Student temp = curr->data;
				curr->data = s->data;
				s->data = temp;
				curr = curr->next;
			}
			// 设置学生的名次
			int cnt=1;
			stu_List *cur = classMap1[i];
			cur->data.rank_in_class = cnt;
			while (cur->next != NULL) {
				cnt++;
				if (cur->data.total == cur->next->data.total) {
					cur->next->data.rank_in_class = cur->data.rank_in_class;
				} else {
					cur->next->data.rank_in_class = cnt;
				}
				cur = cur->next;
			}
		}
		// 将排名信息同步到原始链表中
		stu_List *cur = classMap1[i];
		while (cur != NULL) {
			stu_List*current1 = L1;
			while (current1 != NULL) {
				if (current1->data.id == cur->data.id) {
					current1->data.rank_in_class = cur->data.rank_in_class;
					break;
				}
				current1 = current1->next;
			}
			cur = cur->next;
		}
	}
	for (int i = 1; i < Class_number; i++) {
		if (classMap2[i] != NULL) {
			// 对该班级的学生列表进行排序
			stu_List *curr = classMap2[i];
			while (curr != NULL) {
				stu_List *s = curr;
				stu_List *p = curr->next;
				while (p != NULL) {
					if (s->data.total < p->data.total) {
						s = p;
					}
					p = p->next;
				}
				// 交换节点数据
				Student temp = curr->data;
				curr->data = s->data;
				s->data = temp;
				curr = curr->next;
			}
			// 设置学生的名次
			int cnt=1;
			stu_List *cur = classMap2[i];
			cur->data.rank_in_class = cnt;
			while (cur->next != NULL) {
				cnt++;
				if (cur->data.total == cur->next->data.total) {
					cur->next->data.rank_in_class = cur->data.rank_in_class;
				} else {
					cur->next->data.rank_in_class =cnt;
				}
				cur = cur->next;
			}
		}
		// 将排名信息同步到原始链表中
		stu_List *cur = classMap2[i];
		while (cur != NULL) {
			stu_List*current2 = L2;
			while (current2 != NULL) {
				if (current2->data.id == cur->data.id) {
					current2->data.rank_in_class = cur->data.rank_in_class;
					break;
				}
				current2 = current2->next;
			}
			cur = cur->next;
		}
	}
}

//校级排名
void rank_school() {
	stu_List *p = L1, *q = L2;
	stu_List *curr = p;
	while (curr != NULL) {
		stu_List *s1 = curr;
		stu_List *s2 = curr->next;
		while (s2 != NULL) {
			if (s1->data.total < s2->data.total) {
				s1 = s2;
			}
			s2 = s2->next;
		}
		// 交换节点数据
		Student temp = curr->data;
		curr->data = s1->data;
		s1->data = temp;
		curr = curr->next;
	}
	// 设置学生的名次
	int cnt=1;
	stu_List *cur1 = p;
	cur1->data.rank_in_school = cnt;
	while (cur1->next != NULL) {
		cnt++;
		if (cur1->data.total == cur1->next->data.total) {
			cur1->next->data.rank_in_school = cur1->data.rank_in_school;
		} else {
			cur1->next->data.rank_in_school = cnt;
		}
		cur1 = cur1->next;
	}
	// 将排名信息同步到原始链表中
	curr = q;
	while (curr != NULL) {
		stu_List *s1 = curr;
		stu_List *s2 = curr->next;
		while (s2 != NULL) {
			if (s1->data.total < s2->data.total) {
				s1 = s2;
			}
			s2 = s2->next;
		}
		// 交换节点数据
		Student temp = curr->data;
		curr->data = s1->data;
		s1->data = temp;
		curr = curr->next;
	}

	// 设置学生的名次
	int cnt1= 1;
	stu_List *cur2 = q;
	cur2->data.rank_in_school = cnt1;
	while (cur2->next != NULL) {
		cnt1++;
		if (cur2->data.total == cur2->next->data.total) {
			cur2->next->data.rank_in_school = cur2->data.rank_in_school;
		} else {
			cur2->next->data.rank_in_school = cnt1;
		}
		cur2 = cur2->next;
	}
}

/*************排序函数*************/
void sort_print() {
	stu_List *p = L1, *q = L2;
	printf("\t\t\t**************本科生全部信息**************\n");
	printf("\n                                               \n");
	while (p != NULL) {
		printf("\n姓名:%s 学号:%2d  性别:%s  专业:%s  班级:%s  ",
		       p->data.name,
		       p->data.id,
		       p->data.gender == MALE ? "男" : "女",
		       p->data.major,
		       p->data.Class);
		printf("高数:%2d  ", p->data.math_score);
		printf("C语言:%2d  ", p->data.Cprogram_score);
		printf("英语:%2d  ", p->data.english_score);
		printf("总成绩:%2d  ", p->data.total);
		printf("校级排名:%2d\n", p->data.rank_in_school);
		p = p->next;
	}
	printf("\n\t\t\t**************研究生全部信息**************\n");
	printf("\n                                               \n");
	while (q != NULL) {
		printf("\n姓名:%s 学号:%2d  性别:%s  专业:%s  班级:%s  ",
		       q->data.name,
		       q->data.id,
		       q->data.gender == MALE ? "男" : "女",
		       q->data.major,
		       q->data.Class);
		printf("综合课程成绩:%2d  ", q->data.compre_course_score);
		printf("论文成绩:%2d  ", q->data.dissertation_score);
		printf("总成绩:%2d  ", q->data.total);
		printf("校级排名:%2d\n", q->data.rank_in_school);
		q = q->next;
	}
}

void class_search() {
	stu_List *classMap1[Class_number] = {NULL}, *classMap2[Class_number] = {NULL};
	int k;
	printf("请输入你要查询班级:");
	scanf("%d",&k);
	rank_Class(classMap1,classMap2);
	if (classMap1[k] != NULL) {
		stu_List *p = classMap1[k];
		while (p != NULL) {
			printf("\n姓名:%s 学号:%2d  性别:%s  专业:%s  班级:%s  ",
			       p->data.name,
			       p->data.id,
			       p->data.gender == MALE ? "男" : "女",
			       p->data.major,
			       p->data.Class);
			printf("高数:%2d  ", p->data.math_score);
			printf("C语言:%2d  ", p->data.Cprogram_score);
			printf("英语:%2d  ", p->data.english_score);
			printf("总成绩:%2d  ", p->data.total);
			printf("班级排名:%2d\n", p->data.rank_in_class);
			p=p->next;
		}
	} else if (classMap2[k] != NULL) {
		stu_List *p = classMap2[k];
		while (p != NULL) {
			printf("\n姓名:%s 学号:%2d  性别:%s  专业:%s  班级:%s  ",
			       p->data.name,
			       p->data.id,
			       p->data.gender == MALE ? "男" : "女",
			       p->data.major,
			       p->data.Class);
			printf("课程综合成绩:%2d  ", p->data.compre_course_score);
			printf("论文成绩:%2d  ", p->data.dissertation_score);
			printf("总成绩:%2d  ", p->data.total);
			printf("班级排名:%2d\n", p->data.rank_in_class);
			p=p->next;
		}
	} else {
		printf("查无此班级!\n");
	}
}
  • 查询功能
/**************查询函数************/


// 显示所有学生信息
void displayAllStudents() {
	stu_List *p = L1, *q = L2;
	int i = 0, j = 0, k;
	stu_List a[MAX_SIZE], b[MAX_SIZE];
	while (p != NULL) {
		a[i++] = *p;
		p = p->next;
	}
	int c = i / 10;
	while (q != NULL) {
		b[j++] = *q;
		q = q->next;
	}
	int d = j / 10;
	printf("\t\t\t************本科生全部信息********\n");
	while (1) {
		printf("\n\t1-首页\t2-上一页\t3-下一页\t4-尾页\t5-研究生信息\n");
		printf("请选择->");
		scanf("%d", &k);
		int page1 = 1;
		switch (k) {
			case 1:
				page1 = 1;
				for (int l = 0; l < 10 && l < i; l++) {
					printf("\n姓名:%10s  学号:%2d   性别:%s   专业:%20s\t\t班级:%s\t",
					       a[l].data.name,
					       a[l].data.id,
					       a[l].data.gender == MALE ? "男" : "女",
					       a[l].data.major,
					       a[l].data.Class);
					printf("高数:%2d  ", a[l].data.math_score);
					printf("C语言:%2d  ", a[l].data.Cprogram_score);
					printf("英语: %2d  ", a[l].data.english_score);
					printf("总成绩:%2d  ", a[l].data.total);
					printf("班级排名:%2d  ", a[l].data.rank_in_class);
					printf("校级排名:%2d\n", a[l].data.rank_in_school);
				}
				break;
			case 2:
				page1--;
				if (page1 == 1) {
					for (int l = 0; l < 10 && l < i; l++) {
						printf("\n姓名:%10s  学号:%2d   性别:%s   专业:%20s\t\t班级:%s\t",
					       a[l].data.name,
					       a[l].data.id,
					       a[l].data.gender == MALE ? "男" : "女",
					       a[l].data.major,
					       a[l].data.Class);
					printf("高数:%2d  ", a[l].data.math_score);
					printf("C语言:%2d  ", a[l].data.Cprogram_score);
					printf("英语: %2d  ", a[l].data.english_score);
					printf("总成绩:%2d  ", a[l].data.total);
					printf("班级排名:%2d  ", a[l].data.rank_in_class);
					printf("校级排名:%2d\n", a[l].data.rank_in_school);
					}

				} else {
					for (int l = (page1 - 1) * 10; l < page1 * 10 && l < i; l++) {
						printf("\n姓名:%10s  学号:%2d   性别:%s   专业:%20s\t\t班级:%s\t",
					       a[l].data.name,
					       a[l].data.id,
					       a[l].data.gender == MALE ? "男" : "女",
					       a[l].data.major,
					       a[l].data.Class);
					printf("高数:%2d  ", a[l].data.math_score);
					printf("C语言:%2d  ", a[l].data.Cprogram_score);
					printf("英语: %2d  ", a[l].data.english_score);
					printf("总成绩:%2d  ", a[l].data.total);
					printf("班级排名:%2d  ", a[l].data.rank_in_class);
					printf("校级排名:%2d\n", a[l].data.rank_in_school);
					}

				}
				break;
			case 3:
				page1++;
				for (int l = (page1 - 1) * 10; l < page1 * 10 && l < i; l++) {
					printf("\n姓名:%10s  学号:%2d   性别:%s   专业:%20s\t\t班级:%s\t",
					       a[l].data.name,
					       a[l].data.id,
					       a[l].data.gender == MALE ? "男" : "女",
					       a[l].data.major,
					       a[l].data.Class);
					printf("高数:%2d  ", a[l].data.math_score);
					printf("C语言:%2d  ", a[l].data.Cprogram_score);
					printf("英语: %2d  ", a[l].data.english_score);
					printf("总成绩:%2d  ", a[l].data.total);
					printf("班级排名:%2d  ", a[l].data.rank_in_class);
					printf("校级排名:%2d\n", a[l].data.rank_in_school);
				}

				break;
			case 4:
				page1 = d + 1;
				for (int l = page1 * 10; l < i; l++) {
					printf("\n姓名:%10s  学号:%2d   性别:%s   专业:%20s\t\t班级:%s\t",
					       a[l].data.name,
					       a[l].data.id,
					       a[l].data.gender == MALE ? "男" : "女",
					       a[l].data.major,
					       a[l].data.Class);
					printf("高数:%2d  ", a[l].data.math_score);
					printf("C语言:%2d  ", a[l].data.Cprogram_score);
					printf("英语: %2d  ", a[l].data.english_score);
					printf("总成绩:%2d  ", a[l].data.total);
					printf("班级排名:%2d  ", a[l].data.rank_in_class);
					printf("校级排名:%2d\n", a[l].data.rank_in_school);
				}

				break;
			case 5:
				goto start;
			default:
				printf("输入错误,请重试!!\n");
		}
	}
start:
	printf("\t\t\t************研究生全部信息********\n");
	while (1) {
		printf("\t1-首页\t2-上一页\t3-下一页\t4-尾页\t5-退出\n");
		scanf("%d", &k);
		int page2 = 1;
		switch (k) {
			case 1:
				page2 = 1;
				for (int l = 0; l < 10 && l < j; l++) {
					printf("姓名:%10s 学号:%2d  性别:%s  专业:%20s\t\t班级:%s\t",
					       b[l].data.name,
					       b[l].data.id,
					       b[l].data.gender == MALE ? "男" : "女",
					       b[l].data.major,
					       b[l].data.Class);
					printf("课程综合成绩:%2d  ", b[l].data.compre_course_score);
					printf("论文成绩:%2d  ", b[l].data.dissertation_score);
					printf("总成绩:%2d  ", b[l].data.total);
					printf("班级排名:%2d  ", b[l].data.rank_in_class);
					printf("校级排名:%2d\n", b[l].data.rank_in_school);
				}

				break;
			case 2:
				page2--;
				if (page2 == 1) {
					for (int l = 0; l < 10 && l < j; l++) {
						printf("姓名:%10s 学号:%2d  性别:%s  专业:%20s\t\t班级:%s\t",
					       b[l].data.name,
					       b[l].data.id,
					       b[l].data.gender == MALE ? "男" : "女",
					       b[l].data.major,
					       b[l].data.Class);
					printf("课程综合成绩:%2d  ", b[l].data.compre_course_score);
					printf("论文成绩:%2d  ", b[l].data.dissertation_score);
					printf("总成绩:%2d  ", b[l].data.total);
					printf("班级排名:%2d  ", b[l].data.rank_in_class);
					printf("校级排名:%2d\n", b[l].data.rank_in_school);
					}

				} else {
					for (int l = (page2 - 1) * 10; l < page2 * 10 && l < j; l++) {
						printf("姓名:%10s 学号:%2d  性别:%s  专业:%20s\t\t班级:%s\t",
					       b[l].data.name,
					       b[l].data.id,
					       b[l].data.gender == MALE ? "男" : "女",
					       b[l].data.major,
					       b[l].data.Class);
					printf("课程综合成绩:%2d  ", b[l].data.compre_course_score);
					printf("论文成绩:%2d  ", b[l].data.dissertation_score);
					printf("总成绩:%2d  ", b[l].data.total);
					printf("班级排名:%2d  ", b[l].data.rank_in_class);
					printf("校级排名:%2d\n", b[l].data.rank_in_school);
					}

				}
				break;
			case 3:
				page2++;
				for (int l = (page2 - 1) * 10; l < page2 * 10 && l < j; l++) {
					printf("姓名:%10s 学号:%2d  性别:%s  专业:%20s\t\t班级:%s\t",
					       b[l].data.name,
					       b[l].data.id,
					       b[l].data.gender == MALE ? "男" : "女",
					       b[l].data.major,
					       b[l].data.Class);
					printf("课程综合成绩:%2d  ", b[l].data.compre_course_score);
					printf("论文成绩:%2d  ", b[l].data.dissertation_score);
					printf("总成绩:%2d  ", b[l].data.total);
					printf("班级排名:%2d  ", b[l].data.rank_in_class);
					printf("校级排名:%2d\n", b[l].data.rank_in_school);
				}

				break;
			case 4:
				page2 = d + 1;
				for (int l = page2 * 10; l < j; l++) {
					printf("姓名:%10s 学号:%2d  性别:%s  专业:%20s\t\t班级:%s\t",
					       b[l].data.name,
					       b[l].data.id,
					       b[l].data.gender == MALE ? "男" : "女",
					       b[l].data.major,
					       b[l].data.Class);
					printf("课程综合成绩:%2d  ", b[l].data.compre_course_score);
					printf("论文成绩:%2d  ", b[l].data.dissertation_score);
					printf("总成绩:%2d  ", b[l].data.total);
					printf("班级排名:%2d  ", b[l].data.rank_in_class);
					printf("校级排名:%2d\n", b[l].data.rank_in_school);
				}

				break;
			case 5:
				return ;
			default:
				printf("输入错误,请重试!!\n");
		}
	}
}



// 按班级显示学生信息
void display_class() {
	stu_List *classMap1[Class_number] = {NULL}, *classMap2[Class_number] = {NULL};
	int k;
	printf("请输入你要查询班级:");
	scanf("%d",&k);
	classify_class(classMap1, classMap2);
	if (classMap1[k] != NULL) {
		stu_List *p = classMap1[k];
		while (p != NULL) {
			printf("姓名:%s\t学号:%d\t性别:%s\t专业:%s\t班级:%s\t",
			       p->data.name,
			       p->data.id,
			       p->data.gender == MALE ? "男" : "女",
			       p->data.major,
			       p->data.Class);
			printf("高数:%d  ", p->data.math_score);
			printf("C语言:%d  ", p->data.Cprogram_score);
			printf("英语:%d  ", p->data.english_score);
			printf("总成绩:%d  ", p->data.total);
			printf("班级排名:%d  ", p->data.rank_in_class);
			printf("校级排名:%d\n", p->data.rank_in_school);
			p=p->next;
		}
	} else if (classMap2[k] != NULL) {
		stu_List *p = classMap2[k];
		while (p != NULL) {
			printf("姓名:%s 学号:%d  性别:%s  专业:%s  班级:%s  ",
			       p->data.name,
			       p->data.id,
			       p->data.gender == MALE ? "男" : "女",
			       p->data.major,
			       p->data.Class);
			printf("课程综合成绩:%d  ", p->data.compre_course_score);
			printf("论文成绩:%d  ", p->data.dissertation_score);
			printf("总成绩:%d  ", p->data.total);
			printf("班级排名:%d  ", p->data.rank_in_class);
			printf("校级排名:%d\n", p->data.rank_in_school);
			p=p->next;
		}
	} else {
		printf("查无此班级!\n");
	}
}

// 按学号/姓名查询学生信息
void search_id_or_name() {
	int d;
	char name[20];
	printf("请输入学号(不知道请输入0):");
	scanf("%d",&d);
	printf("或者姓名:(不知道请输入“NULL”)");
	scanf("%s",name);
	if (d != 0) {
		stu_List *p = L1;
		while (p != NULL && p->data.id != d) {
			p = p->next;
		}
		if (p != NULL) {
			printf("姓名:%s 学号:%d  性别:%s  专业:%s  班级:%s  ",
			       p->data.name,
			       p->data.id,
			       p->data.gender == MALE ? "男" : "女",
			       p->data.major,
			       p->data.Class);
			printf("高数:%d  ", p->data.math_score);
			printf("C语言:%d  ", p->data.Cprogram_score);
			printf("英语:%d  ", p->data.english_score);
			printf("总成绩:%d  ", p->data.total);
			printf("班级排名:%d  ", p->data.rank_in_class);
			printf("校级排名:%d\n", p->data.rank_in_school);
			return;
		} else {
			stu_List *p = L2;
			while (p != NULL && p->data.id != d) {
				p = p->next;
			}
			if (p != NULL) {
				printf("姓名:%s 学号:%d  性别:%s  专业:%s  班级:%s  ",
				       p->data.name,
				       p->data.id,
				       p->data.gender == MALE ? "男" : "女",
				       p->data.major,
				       p->data.Class);
				printf("课程综合成绩:%d  ", p->data.compre_course_score);
				printf("论文成绩:%d  ", p->data.dissertation_score);
				printf("总成绩:%d  ", p->data.total);
				printf("班级排名:%d  ", p->data.rank_in_class);
				printf("校级排名:%d\n", p->data.rank_in_school);
				return;
			}
		}
	} else {
		stu_List *p = L1;
		while (p != NULL && strcmp(p->data.name, name) != 0) {
			p = p->next;
		}
		if (p != NULL) {
			printf("姓名:%s 学号:%d  性别:%s  专业:%s  班级:%s  ",
			       p->data.name,
			       p->data.id,
			       p->data.gender == MALE ? "男" : "女",
			       p->data.major,
			       p->data.Class);
			printf("高数:%d  ", p->data.math_score);
			printf("C语言:%d  ", p->data.Cprogram_score);
			printf("英语:%d  ", p->data.english_score);
			printf("总成绩:%d  ", p->data.total);
			printf("班级排名:%d  ", p->data.rank_in_class);
			printf("校级排名:%d\n", p->data.rank_in_school);
			return;
		} else {
			stu_List *p = L2;
			while (p != NULL && strcmp(p->data.name, name) == 0) {
				p = p->next;
			}
			if (p != NULL) {
				printf("姓名:%s 学号:%d  性别:%s  专业:%s  班级:%s  ",
				       p->data.name,
				       p->data.id,
				       p->data.gender == MALE ? "男" : "女",
				       p->data.major,
				       p->data.Class);
				printf("课程综合成绩:%d  ", p->data.compre_course_score);
				printf("论文成绩:%d  ", p->data.dissertation_score);
				printf("总成绩:%d  ", p->data.total);
				printf("班级排名:%d  ", p->data.rank_in_class);
				printf("校级排名:%d\n", p->data.rank_in_school);
				return;
			}
		}
	}
}

// 按班级查询不及格学生信息
void search_failed_students() {
	stu_List *classMap1[Class_number] = {NULL}, *classMap2[Class_number] = {NULL};
	int k;
	char course[20];
	printf("请输入你要查询班级:");
	scanf("%d",&k);
	printf("请输入要查询的课程:");
	scanf("%s",course);
	classify_class(classMap1, classMap2);
	if (classMap1[k] != NULL) {
		stu_List *p = classMap1[k];
		while (p != NULL) {
			if (strcmp(course, "C语言") == 0 && p->data.Cprogram_score < 60) {
				printf("姓名:%10s 学号:%d  性别:%s  专业:%10s\t班级:%s\t",
				       p->data.name,
				       p->data.id,
				       p->data.gender == MALE ? "男" : "女",
				       p->data.major,
				       p->data.Class);
				printf("C语言:%d\n", p->data.Cprogram_score);
			} else  if (strcmp(course, "高数") == 0 && p->data.math_score < 60) {
				printf("姓名:%10s 学号:%d  性别:%s  专业:%10s\t班级:%s\t",
				       p->data.name,
				       p->data.id,
				       p->data.gender == MALE ? "男" : "女",
				       p->data.major,
				       p->data.Class);
				printf("高数:%d\n", p->data.math_score);
			} else if (strcmp(course, "英语") == 0 && p->data.english_score < 60) {
				printf("姓名:%10s 学号:%d  性别:%s  专业:%10s\t班级:%s\t",
				       p->data.name,
				       p->data.id,
				       p->data.gender == MALE ? "男" : "女",
				       p->data.major,
				       p->data.Class);
				printf("英语:%d\n", p->data.english_score);
			}
			p=p->next;
		}
	} else if (classMap2[k] != NULL) {
		stu_List *p = classMap2[k];
		while (p != NULL) {
			if (strcmp(course, "课程综合") == 0 && p->data.compre_course_score != -1) {
				printf("姓名:%10s 学号:%d  性别:%s  专业:%10s\t班级:%s\t",
				       p->data.name,
				       p->data.id,
				       p->data.gender == MALE ? "男" : "女",
				       p->data.major,
				       p->data.Class);
				printf("课程综合成绩:%d\n", p->data.compre_course_score);
			} else  if (strcmp(course, "论文") == 0 && p->data.dissertation_score != -1) {
				printf("姓名:%10s 学号:%d  性别:%s  专业:%10s\t班级:%s\t",
				       p->data.name,
				       p->data.id,
				       p->data.gender == MALE ? "男" : "女",
				       p->data.major,
				       p->data.Class);
				printf("论文成绩:%d\n", p->data.dissertation_score);
			}
			p=p->next;
		}
	
	}
}
  • 统计功能
/*************统计功能***************/

// 统计并显示某门课每个班的平均成绩
void calculate_Average_Class() {
	char course[20];
	int k;
	printf("你想查询0-本科生,还是1-研究生课程:(请输入数字)");
	scanf("%d",&k);
	printf("你想查询哪门课程信息:");
	scanf("%s",course);
	stu_List *classMap1[Class_number] = {NULL}, *classMap2[Class_number] = {NULL};
	classify_class(classMap1, classMap2);
	if (k == 0) {
		for (int i = 1; i < Class_number&&classMap1[i]!=NULL; i++) {
			stu_List *p = classMap1[i];
			int sum = 0, cnt = 0;
			while (p != NULL) {
				if (strcmp(course, "C语言") == 0 && p->data.Cprogram_score != -1) {
					sum += p->data.Cprogram_score;
					cnt++;
				} else  if (strcmp(course, "高数") == 0 && p->data.math_score != -1) {
					sum += p->data.math_score;
					cnt++;
				} else if (strcmp(course, "英语") == 0 && p->data.english_score != -1) {
					sum += p->data.english_score;
					cnt++;
				}
				p = p->next;
			}
			printf("%d班%s平均成绩:%.2f\n", i, course, sum * 1.0 / (cnt - 1));
		}

	} else {
		for (int i = 1; i < Class_number&&classMap2[i]!=NULL; i++) {
			stu_List *p = classMap2[i];
			int sum = 0, cnt = 0;
			while (p != NULL) {
				if (strcmp(course, "综合课程") == 0 && p->data.Cprogram_score != -1) {
					sum += p->data.compre_course_score;
					cnt++;
				} else  if (strcmp(course, "论文") == 0 && p->data.math_score != -1) {
					sum += p->data.dissertation_score;
					cnt++;
				}
				p = p->next;
			}
			printf("%d班%s平均成绩:%.2f\n", i, course, sum * 1.0 / (cnt - 1));
		}
	}

}

// 统计并显示某个班级某门课程不同等级的学生人数
void calculate_Display_Grade() {
	char course[20];
	int k;
	printf("请输入要查询班级(数字):");
	scanf("%d",&k);
	printf("你想查询哪门课程信息:");
	scanf("%s",course);
	stu_List *classMap1[Class_number] = {NULL}, *classMap2[Class_number] = {NULL};
	classify_class(classMap1, classMap2);
	int level[5] = {0};
	if (classMap1[k] != NULL) {
		stu_List *p = classMap1[k];
		while (p != NULL) {
			if (strcmp(course, "C语言") == 0 && p->data.Cprogram_score != -1) {
				if (p->data.Cprogram_score >= 90)
					level[0]++;
				else if (p->data.Cprogram_score >= 80 && p->data.Cprogram_score < 90)
					level[1]++;
				else if (p->data.Cprogram_score >= 70 && p->data.Cprogram_score < 80)
					level[2]++;
				else if (p->data.Cprogram_score >= 60 && p->data.Cprogram_score < 70)
					level[3]++;
				else
					level[4]++;
			} else  if (strcmp(course, "高数") == 0 && p->data.math_score != -1) {
				if (p->data.math_score >= 90)
					level[0]++;
				else if (p->data.math_score >= 80 && p->data.math_score < 90)
					level[1]++;
				else if (p->data.math_score >= 70 && p->data.math_score < 80)
					level[2]++;
				else if (p->data.math_score >= 60 && p->data.math_score < 70)
					level[3]++;
				else
					level[4]++;
			} else if (strcmp(course, "英语") == 0 && p->data.english_score != -1) {
				if (p->data.english_score >= 90)
					level[0]++;
				else if (p->data.english_score >= 80 && p->data.english_score < 90)
					level[1]++;
				else if (p->data.english_score >= 70 && p->data.english_score < 80)
					level[2]++;
				else if (p->data.english_score >= 60 && p->data.english_score < 70)
					level[3]++;
				else
					level[4]++;
			}
			p = p->next;
		}
	} else if (classMap2[k] != NULL) {
		stu_List *p = classMap2[k];
		while (p != NULL) {
			if (strcmp(course, "综合课程") == 0 && p->data.compre_course_score != -1) {
				if (p->data.compre_course_score >= 90)
					level[0]++;
				else if (p->data.compre_course_score >= 80 && p->data.compre_course_score < 90)
					level[1]++;
				else if (p->data.compre_course_score >= 70 && p->data.compre_course_score < 80)
					level[2]++;
				else if (p->data.compre_course_score >= 60 && p->data.compre_course_score < 70)
					level[3]++;
				else
					level[4]++;
			} else  if (strcmp(course, "论文") == 0 && p->data.dissertation_score != -1) {
				if (p->data.dissertation_score >= 90)
					level[0]++;
				else if (p->data.dissertation_score >= 80 && p->data.dissertation_score < 90)
					level[1]++;
				else if (p->data.dissertation_score >= 70 && p->data.dissertation_score < 80)
					level[2]++;
				else if (p->data.dissertation_score >= 60 && p->data.dissertation_score < 70)
					level[3]++;
				else
					level[4]++;
			}
			p = p->next;
		}
	}

	printf("%d班%s课程不同等级的学生人数如下:\n", k, course);
	printf("优:%d人\n", level[0]);
	printf("良:%d人\n", level[1]);
	printf("中:%d人\n", level[2]);
	printf("及格:%d人\n", level[3]);
	printf("不及格:%d人\n", level[4]);
}

  • 保存信息到文件
// 读取/保存学生信息到文件
void read_From_File() {
	stu_List *p = NULL, *q = NULL;
	FILE *fp = fopen("undergraduate.txt", "rb");
	if (fp == NULL) {
		printf("文件打开失败!\n");
	} else {
		while (1) {
			p = (stu_List *)malloc(sizeof(stu_List));
			if (fread(p, sizeof(stu_List), 1, fp) != 1) {
				free(p);
				break;
			}
			p->next = NULL;
			if (L1 == NULL)
				L1 = p;
			else {
				p->next = L1->next;
				L1->next = p;
			}
		}
	}
	fclose(fp);
	fp = fopen("postgraduate.txt", "rb");

	if (fp == NULL) {
		printf("文件打开失败!\n");

	} else {
		while (1) {
			q = (stu_List *)malloc(sizeof(stu_List));
			if (fread(q, sizeof(stu_List), 1, fp) != 1) {
				free(q);
				break;
			}
			q->next = NULL;
			if (L2 == NULL)
				L2 = q;
			else {
				q->next = L2->next;
				L2->next = q;
			}
		}
	}
	fclose(fp);
}

void save_To_File() {
	stu_List *p = L1, *q = L2;
	FILE *fp = fopen("undergraduate.txt", "wb");
	while (p != NULL && fwrite(p, sizeof(stu_List), 1, fp) == 1) {
		p = p->next;
	}
	fclose(fp);
	fp = fopen("postgraduate.txt", "wb");

	while (q != NULL && fwrite(q, sizeof(stu_List), 1, fp) == 1) {
		q = q->next;
	}
	fclose(fp);
}

void read_maxid() {
	FILE *fp = fopen("student_id.txt", "r");
	if (fp == NULL) {
		printf("文件打开失败!\n");
		return;
	}
	fscanf(fp, "%d", &maxid);
	fclose(fp);
}

void save_maxid() {
	FILE *fp = fopen("student_id.txt", "w");
	fprintf(fp, "%d", maxid);
	fclose(fp);
}

  • 菜单管理
void studentManagerMenu(){
	printf("                          1.基本资料数据的维护管理                         \n");
	printf("                          2.成绩数据的维护管理                             \n");
	int i,j;
	printf("请选择:>");
	scanf("%d",&i);
	switch(i){
		case 1:
			printf("                          1.添加学生基本资料数据                           \n");
			printf("                          2.修改学生基本资料数据                           \n");
			printf("                          3.删除学生基本资料数据                           \n");
			printf("                          4.查询学生基本资料数据                           \n");
			printf("请选择:>");
			scanf("%d",&j);
			switch(j){
				case 1:
					add_student();break;
				case 2:
					modify_basic_data();break;
				case 3:
					delete_student();break;
				case 4:
					search_student();break;
			}
			break;
		case 2:
			printf("                  1.添加/修改/删除学生成绩资料数据                 \n");
			printf("                  2.查询学生成绩资料数据                           \n");
			printf("请选择:>");
			scanf("%d",&j);
			switch(j){
				case 1:
					add_student_score();break;
				case 2:
			 		search_score();break;
			}
			break;
		default:
				printf("输入错误,请重试!\n");
				system("pause");
				system("cls");
	}
}
void searchMenu(){
	stu_List *classMap1[Class_number] = {NULL}, *classMap2[Class_number] = {NULL};
	printf("				1.显示全部学生信息                              \n");
	printf("				2.按班级显示学生信息                            \n");
	printf("				3.学号/姓名显示学生信息                          \n");
	printf("				4.按班级显示不及格学生信息                       \n");
	int i;
	printf("请选择:>");
	scanf("%d",&i);
	switch(i){
		case 1:
			calculate_score();
			rank_Class(classMap1,classMap2);
			rank_school();
			displayAllStudents();break;
		case 2:
			calculate_score();
			rank_Class(classMap1,classMap2);
			rank_school();
			display_class();break;
		case 3:
			calculate_score();
			rank_Class(classMap1,classMap2);
			rank_school();
			search_id_or_name();
		case 4:
			calculate_score();
			rank_Class(classMap1,classMap2);
			rank_school();
			search_failed_students();break;
		default:
			printf("输入错误,请重试!\n");
			system("pause");
			system("cls");
	}
}
void sortMenu(){
	calculate_score();
	printf("                             1.所有学生排名显示                               \n");
	printf("                             2.按班级排名显示                                 \n");
	int i;
	printf("请选择:>");
	scanf("%d",&i);
	switch(i){
		case 1:
			rank_school();
			sort_print();
			system("pause");
			system("cls");break;
		case 2:
			class_search();
			system("pause");
			system("cls");break;
		default:
				printf("输入错误,请重试!\n");
				system("pause");
				system("cls");
	}
}
void statisticMenu(){
	printf("                            1.班级课程平均成绩                             \n");
	printf("                            2.班级课程不同等级人数                         \n");
	int i;
	printf("请选择:>");
	scanf("%d",&i);
	switch(i){
		case 1:
			calculate_Average_Class();break;
		case 2:
			calculate_Display_Grade();break;
		default:
				printf("输入错误,请重试!\n");
				system("pause");
				system("cls");
	}
}
  • 主函数
int main() {
	read_maxid();
	read_From_File();
	int i;
	while (1) {
		printf("-------------------------------------------------------------------------\n");
		printf("                        欢迎使用高校学生信息管理系统                     \n");
		printf("-------------------------------------------------------------------------\n");
		printf("                               请选择系统功能                     		  \n");
		printf("-------------------------------------------------------------------------\n");
		printf("                             1.学生数据管理菜单                          \n");
		printf("                             2.查询菜单                                  \n");
		printf("                             3.排序菜单	                  			     \n");
		printf("                             4.统计菜单                  		         \n");
		printf("                             0.退出系统                                  \n");
		printf("-------------------------------------------------------------------------\n");
		printf("请选择:>");
		scanf("%d", &i);
		switch (i) {
			case 1:
				studentManagerMenu();
				break;
			case 2:
				searchMenu();
				break;
			case 3:
				sortMenu();
				break;
			case 4:
				statisticMenu();
				break;
			case 0:
				save_To_File();
				save_maxid();
				printf("感谢您的使用,再见!");
				exit(0);
			default:
				printf("输入错误,请重试!\n");
				system("pause");
				system("cls");
		}
	}

	return 0;
}