?? subject.h
字號:
#include"student.h"
struct student_message
{
student stu;
student_message *Next;
};
struct student_name
{
char tname[20]; //學生的名字
float result; //學生所得的該課程分數
student_name *Next;
};
/////////////////////////////////////////////////////////////////////////////////////////////
//課程類
class subject
{
public:
subject()
{
first = 0;
maxstudent=30;
activestudnet=0;
}
float read_credit(); //得到課程的學分
void get_credit(float a); //設置學分
void get_kname(char N[]); //讀出課程的名稱
void set_kname(char N[]); //讀入課程的名稱
student_name *retfirst()
{
return first; //返回根結點
}
void findstudent(student_message *P); //根據該課程的名稱,尋找選這課程的學生
int retactivestudent()
{
return activestudnet; //返回實際學生數
}
int retmaxstudent()
{
return 30; //返回最多學生數30
}
void clractivestudnet()
{
activestudnet = 0; //從文件中讀出來后將實際學生數清零
}
private:
int maxstudent; //最多學生數
int activestudnet; //實際學生數
student_name *first; //學生名單
float credit; //該課程的學分
char kname[20]; //該課程的名稱
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -