先做以下说明:
1.代码原创,但是也有BUG,我没有写差错处理,正常运行观测没有问题;
2.本人并不是大佬,只是代码小学僧而已,各位大佬留情。
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <stdio.h>
#define MAX 100
typedef struct {
char name[20];
char id[10];
int age;
char address[20];
char tel[15];
}PersonInfo;
typedef struct Node {
PersonInfo person[MAX];
char classid[10];
int count;
struct Node * next;
}ClassInfo;
ClassInfo * CreateListR(FILE *fp);//最开始的录入学生信息
void Demand(ClassInfo * L,string cla, string s);//查找学生信息
void Delect(ClassInfo *L, string id,string cla, FILE * fp);//删除学生信息
void DisList(ClassInfo * L);//输出链表中的数据
void Updata(ClassInfo *L, FILE *fp);//更新文件中的信息
void Amend(ClassInfo *L, string cla, string id);//修改学生信息
void BubbleSort(ClassInfo *L,string cla);//对班级中的学生信息进行排序
void Addition(ClassInfo **L, string cla);//添加学生信息
void FilePut(FILE * fp) { //负责输入基本说明和给文件中的数据加上属性名
fputs("学号\t", fp);
fputs("姓名\t", fp);
fputs("年龄\t", fp);
fputs("地址\t", fp);
fputs("电话\t", fp);
fputs("班级\t", fp);
cout << "====================================================" << endl;
cout << " 学生管理系统 " << endl;
cout << "====================================================" << endl;
cout << "使用说明:" << endl;
cout << "1:录入学生信息和班级信息" << endl;
cout << "2:查询学生信息(仅支持学号查询)" << endl;
cout << "3:删除学生信息(仅支持根据学号删除)" << endl;
cout << "4:修改学生信息" << endl;
cout << "5:将学生信息按学号排序" << endl;
cout << "6:增加学生信息" << endl;
cout << "7:查看已经录入的学生信息" << endl;
cout << "temp=0则结束输入,反之继续输入" << endl;
}
void Switch(ClassInfo *stu, FILE * fp) {