#include<iostream>
#include<string>
#include<list>
#include<fstream>
#include<functional>
#include<Windows.h>
#include<algorithm>
using namespace std;
class Teacher
{
public:
string name;
int xuehao;
int score;
Teacher(string str1, int xh, int sc)//有参构造函数
{
this->name = str1;
this->xuehao = xh;
this->score = sc;
}
Teacher(const Teacher &st1)//拷贝构造函数
{
this->name = st1.name;
this->xuehao = st1.xuehao;
this->score = st1.xuehao;
}
Teacher &operator=(const Teacher &str1)//重载=
{
this->name = str1.name;
this->xuehao = str1.xuehao;
this->score = str1.xuehao;
return *this;
}
bool operator<(const Teacher &str1) const
{
return (this->score<str1.score ? 1 : 0);
}
bool operator>(const Teacher &str1) const
{
return (this->score>str1.score ? 1 : 0);
}
bool operator==(const Teacher &str1) const
{
return (this->score == str1.score ? 1 : 0);
}
void print()
{
cout << "姓名为"<<this->name <<"工号为"<< this->xuehao << "评分"<<this->score << endl;
cout << "------------------" << endl;
}
};
class Student
{
public:
Student(int&k, string&name)//构造函数
{
this->xuehao = k;
this->name = name;
}
int xuehao;
string name;
};
list<Teacher> mylist;//链表
list<Student> stlist;//链表
void showjiben()
{
cout << "请输入你的学号,查看你的基本信息" << endl;
int flag = 0;
int xuehao;
cin >> xuehao;
auto k = stlist.begin();
for (k; k != stlist.end(); k++)
{
if (xuehao == k->xueha