📄 cpp9.cpp
字号:
#include "cpp9.h"
#include"Administrator.h"
int course::cno=0;
int Student::count=0; //声明静态记录计数变量
/*************************************
* 构造函数
************************************/
Student::Student()
{
next=NULL;
name[0]='0';
no[0]=' ';
ave=0.0;
}
/*************************************
* 析构函数
************************************/
Student::~Student()
{
if (next != NULL)
delete next;
}
void main ( )
{
Administrator *w;
w=new Administrator;
w->Aset();
w->manage();
// delete w;
}
/******************
* 菜单处理函数
******************/
void Student::handle_menu(Student *top)
{
for ( ; ; ) {
switch(menu_select())
{
/*case 1:
top = input(top) ;
break;*/
case 1:
display(top);
break;
case 2:
save(top);
break;
case 3:
top = load(top);
break;
case 4:
top = delete_record(top);
break;
case 5:
short_record(top);
break;
case 6:
top = bad_record(top);
break;
case 7:
find_record(top);
break;
case 8:
cout << "\t退出操作,再见!" << endl;
delete top;
return ;
}
}
}
/*****************
* 菜单选择函数
*****************/
int Student::menu_select()
{
char s[2];
int cn=0;
cout << '\n'
/*<< "\t1. 增加原始记录\n"*/
<< "\t1. 显示各种文件\n"
<< "\t2. 保存原始文件\n"
<< "\t3. 读取原始文件\n"
<< "\t4. 删除原始记录\n"
<< "\t5. 建立简明文件\n"
<< "\t6. 均不及格文件\n"
<< "\t7. 寻找原始记录\n"
<< "\t8. 结束程序运行\n"
<< "\n\t左边数字对应功能选择,请选1-8: " << flush;
for(; ;)
{
gets(s);
cn = atoi(s);
if(cn<1|| cn>8 ) cout << "\n\t输入错误,重选1-8:" << flush;
else break;
}
return cn;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -