student.h
来自「我用二叉搜索树做的学生成绩管理系统」· C头文件 代码 · 共 54 行
H
54 行
#ifndef STUDENT_CLASS
#define STUDENT_CLASS
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include "String.h"
class Student
{
public:
Student();
Student(long & No,String & Name,String & Sex,
long & Score);
Student(long & No){no=No;}
Student(const Student & S);
Student & operator =(Student & S);
virtual ~Student(){};
friend ostream & operator<<(ostream & os,Student & s);
friend istream & operator>>(istream & is,Student & s);
friend ifstream & operator>>(ifstream & in,Student & s);
int operator ==(Student & S) const
{
return no==S.no;
}
int operator !=(Student & S) const
{
return no!=S.no;
}
int operator >(Student & S) const
{
return no>S.no;
}
int operator <(Student & S) const
{
return no<S.no;
}
int operator >=(Student & S) const
{
return score>S.score;
}
int operator <=(Student & S) const
{
return score<S.score;
}
private:
long no;
String name;
String sex;
long score;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?