不多说直接粘代码:
多文件结构
staff.h
#ifndef STAFF_H
#define STAFF_H
#include
#include
#include
#include
poli_tea.h
#ifndef pol_H
#define pol_H
#include
#include
#include
#include "Tea_fun.h"
#include "Administrative.h"
#include
#include
Tea_fun.h
#ifndef TEA_H
#define TEA_H
#include
#include
#include
#include "staff.h"
#include
#include
Administrative.h
#ifndef Ad_H
#define Ad_H
#include
#include
#include "staff.h"
#include
#include
exp.h
#ifndef EXP_H
#define EXP_H
#include
#include
#include "staff.h"
#include
#include
class.h
#ifndef CLASS_H
#define CLASS_H
#include "Administrative.h"
#include "exp.h"
#include "Tea_fun.h"
#include "poli_tea.h"
#include
#include
#include
#include
#include
#include
using namespace std;
class school : public Ad_fun, public Tea_fun, public Exp_fun, public Poli_fun//页面类
{
string ID, Password;
public:
school():Ad_fun(),Tea_fun(),Poli_fun(),Exp_fun()
{}
void Total()
{
system("cls");
system("color 05");
cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
cout << "◆___________________________统计类型_____________________________________◆\n";
cout << "◆ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ◆\n";
cout << "◆ ┃ ●[1]按人数统计 ┃ ◆\n";
cout << "◆ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ◆\n";
cout << "◆ ┃ ●[2]按性别统计 ┃ ◆\n";
cout << "◆ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ◆\n";
cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
char c;
cout << "快命令我:";
while (1)
{
c = getche();
cout << endl;
if (c == '1')
{
cout << "本高校人数有:" << TOP << endl;
break;
}
else if (c == '2')
{
int b = TOP-Na;
cout << "先生人数:" << Na <'6'||ch<'0');
switch(ch)
{
case '0':
return;
case '1':
Tea_fun::Main1();
break;
case '2':
Exp_fun::Main1();
break;
case '3':
Ad_fun::Main1();
break;
case '4':
Poli_fun::Main1();
break;
case '5':
Total();
break;
case '6':
vMain();
break;
}
}
}
void vMain()
{
int t = 1;
while (t)
{
system("cls");
system("color 03");
int i=7,j;
string Id, Pass;
char r,m,ch;
cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
cout << "◆________________________龙龙高校管理员登陆页面________________________◆\n";
cout << "◆ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ◆\n";
cout << "◆ ┃ ●[1]输入你的账号 : ┃ ◆\n";
cout << " ";
cin >> Id;
cout << "◆ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ◆\n";
cout << "◆ ┃ ●[2]密码: ┃ ◆\n";
cout << " ";
cin >> Pass;
cout << "◆ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ◆\n";
cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
system("color fc");
ifstream vip("vip.in",ios::in);
if (!vip)
{
vip.close();
cout << "恭喜你成为第一个用户,免费成为会员。" << endl;
ofstream vip("vip.in",ios::out);
vip << Id << " " << Pass << endl;
vip.close();
vipMain();
}
bool f = true;
while (vip >> ID >> Password)
{
if (ID == Id && Pass == Password)
{
f = false;
cout << "登陆成功!" << endl;
getch();
vip.close();
vipMain();
return;
}
}
if (f)
{
char c;
cout << "密码错误" << endl;
cout << "是否继续(Y/N)"<< endl;
while (1)
{
c = getche();
if (c == 'y' || c == 'Y')
{
vMain();
return;
}
else if (c == 'N' || c == 'n') return;
else cout << "姿势不对请换个姿势!" << endl;
}
}
}
}
void vipMain()
{
int t = 1;
while (t)
{
system("cls");
// system("color 03");
int i=7,j;
char r,m,ch;
cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
cout << "◆________________________龙龙高校成员信息管理系统________________________◆\n";
cout << "◆_______________________________管理员模式_______________________________◆\n";
cout << "◆ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ◆\n";
cout << "◆ 你 ┃ ●[1]教师管理系统 ┃ 管 ◆\n";
cout << "◆ 能 ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ◆\n";
cout << "◆ 控 ┃ ●[2]实验员管理系统 ┃ 理 ◆\n";
cout << "◆ 制 超 ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ◆\n";
cout << "◆ 的 乎 ┃ ●[3]行政人员管理系统 ┃ 员 ◆\n";
cout << "◆ 你 ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ◆\n";
cout << "◆ 的 ┃ ●[4]行政和教师管理系统 ┃ 模 ◆\n";
cout << "◆ 想 ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ◆\n";
cout << "◆ 象 ┃ ●[5]更改管理员账号 ┃ 式 ◆\n";
cout << "◆ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ◆\n";
cout << "◆ ┃ ●[0]退出系统 ┃ ◆\n";
cout << "◆ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ◆\n";
cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
cout << "龙龙系统要为你施展能力,请输入你的命令:";
do
{
ch=getche();
}
while(ch>'5'||ch<'0');
switch(ch)
{
case '0':
return;
case '1':
Tea_fun::Main();
break;
case '2':
Exp_fun::Main();
break;
case '3':
Ad_fun::Main();
break;
case '4':
Poli_fun::Main();
break;
case '5':
vip();
break;
}
}
}
void vip()
{
system("cls");
system("color 5f");
string Id, Pass;
cout << "请输入账号:";
cin >> Id;
cout << "请输入密码:";
cin >> Pass;
ofstream vip("vip.in",ios::out|ios::ate);
vip << Id << " " << Pass << endl;
vip.close();
cout << "注册成功!" << endl;
getch();
vipMain();
}
~school() {}
};
#endif
main.cpp
#include "class.h"
#include
#include
#include
using namespace std;
int main()
{
TOP = 0;
Na = 0;
school S;
S.Main();
return 0;
}