C++课程设计《高校成员信息管理系统》

不多说直接粘代码:

多文件结构

staff.h

#ifndef STAFF_H
#define STAFF_H
#include  
#include 
#include 
#include 
#include 
using namespace std;
const int MAXX = 10000;
static int TOP;
static int Na;
class staf
{
public :

    string id, name, age, sex;
    staf() {}
    void Input();
    void Input(const string &);
    void output();
    void vMain()
    {
        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 << "◆          天      ┃ ●[6]统计                        ┃                  ◆\n";
        cout << "◆          职      ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫                  ◆\n";
        cout << "◆               ★ ┃ ●[0]退出系统                    ┃                  ◆\n";
        cout << "◆               ★ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛                  ◆\n";
        cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
        cout << "请输入你的指令:";
    }
    void MAIN()
    {
        cout << "◆                  ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓                  ◆\n";
        cout << "◆                  ┃ ●[1]查询人员                    ┃                  ◆\n";
        cout << "◆          服      ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫                  ◆\n";
        cout << "◆          务      ┃ ●[2]显示人员                    ┃                  ◆\n";
        cout << "◆          的      ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫                  ◆\n";
        cout << "◆          天      ┃ ●[3]统计                        ┃                  ◆\n";
        cout << "◆          职      ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫                  ◆\n";
        cout << "◆               ★ ┃ ●[0]退出系统                    ┃                  ◆\n";
        cout << "◆               ★ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛                  ◆\n";
        cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
        cout << "请输入你的指令:";
    }
    ~staf() {};
};
void staf::Input()
{
    cout << "编号:" ;
    cin >> id;
    cout << "姓名:";
    cin >> name;
    cout  << "年龄:" ;
    cin >> age;
    cout << "性别:";
    cin >> sex;
}
void staf::Input(const string &n)
{
    id = n;
    cout << "姓名:";
    cin >> name;
    cout  << "年龄:" ;
    cin >> age;
    cout << "性别:";
    cin >> sex;
}
void staf::output()
{
    cout << "编号:" ;
    cout << id;
    cout << endl << "姓名:";
    cout << name;
    cout << endl << "年龄:" ;
    cout << age;
    cout << endl << "性别:";
    cout << sex;
    cout << endl;
}
#endif

poli_tea.h

#ifndef pol_H
#define pol_H
#include  
#include 
#include 
#include "Tea_fun.h"
#include "Administrative.h"
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
class poli_tea : virtual public staf
{
public:
    string politics, zpost;
    string De_xi, major;
    string post;
    void Input(const string &n)
    {
        staf::Input(n);
        cout << "系部:";
        cin >> De_xi;
        cout << "专业:";
        cin >> major;
        cout << "职位:";
        cin >> post;
        cout << "政治关系:";
        cin >> politics;
        cout << "政治职位:";
        cin >> zpost;
    }
    void Input()
    {
        staf::Input();
        cout << "系部:";
        cin >> De_xi;
        cout << "专业:";
        cin >> major;
        cout << "职位:";
        cin >> post;
        cout << "政治关系:";
        cin >> politics;
        cout << "政治职位:";
        cin >> zpost;
    }
    void output()
    {
        staf::output();
        cout << "系部:";
        cout << De_xi << endl;
        cout << "专业:";
        cout << major << endl;
        cout << "职位:";
        cout << post << endl;
        cout << endl << "政治关系:";
        cout << politics;
        cout << endl << "政治职位:";
        cout << zpost;
        cout << endl;
    }
};
class Poli_fun :  virtual public poli_tea
{
    poli_tea Tea[MAXX];
    int top;
public:
    Poli_fun():poli_tea()
    {
        top = 0;
        Read();
    } void Main1()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            system("color 03");
            char ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆_______________________行政教师双兼成员信息管理系统_____________________◆\n";
            staf::MAIN();
            do
            {
                ch=getche();
            }
            while(ch>'3'||ch<'0');
            switch(ch)
            {
            case '1':
                Search();
                break;
            case '2':
                Show();
                break;
            case '3':
                Total();
                break;
            case '0':
                return;
            }
        }
    } void Main()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            system("color 03");
            char ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆_______________________行政教师双兼成员信息管理系统_____________________◆\n";
            cout << "◆________________________________管理员模式______________________________◆\n";
            staf::vMain();
            do
            {
                ch=getche();
            }
            while(ch>'6'||ch<'0');
            switch(ch)
            {
            case '0':
                t = 0;
                break;
            case '1':
                add();
                break;
            case '2':
                Edit();
                break;
            case '3':
                Delete();
                break;
            case '4':
                Search();
                break;
            case '5':
                Show();
                break;
            case '6':
                Total();
                break;
            }
        }
    } void add();
    void Show();
    void Search();
    void Edit();
    void Delete();
    void Total();
    void Save();
    void Read();
    ~Poli_fun()
    {
        Save();
    }
};
void Poli_fun::add()
{
    char c;
    system("cls");
    if (top >= MAXX)
    {
        cout << "尊敬的用户抱歉,此系统该类信息已满!"<< endl << "无法在添加了!"<< endl;
        getche();
        return;
    }
    poli_tea t;
    string d;
    cout << "请输入你要添加的新成员:" << endl;
    cout << "编号:";
    cin >> d;
    for (int i = 0; i < top; i++)
    {
        if (d == Tea[i].id)
        {
            cout << "此用户编号已注册过!" << endl;
            cout << "是否要重新输入?" << endl;
            cout << "是(Y)" << " "  << "否(N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    add();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    t.Input(d);
    Tea[top++] = t;
    TOP++;
    if (t.sex == "男") Na++;
    cout << "新用户添加成功!" << endl;
    cout << "是否继续添加(Y/N): ";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            add();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
}
void Poli_fun::Show()
{
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    for (int i = 0; i < top; i++)
    {
        Tea[i].output();
    }
    cout << "按任意键返回";
    getche();
}
void Poli_fun::Search()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }

    cout << "        1.用编号查询" << endl;
    cout << "        2.用姓名查询" << endl;
    cout << "        3.用相关信息查询" << endl;
    cout << "请输入你想操作的序号:" ;
    int s = 1;
    char k = '0';
    while (s)
    {
        k = getche();
        if (k == '1' || k == '2' || k == '3')
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == '2')
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else
    {
        cout << "请输入你想要有关信息:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd || Tea[i].age == dd || Tea[i].id == dd || Tea[i].politics == dd || Tea[i].zpost == dd || Tea[i].major == dd || Tea[i].post == dd || Tea[i].politics == dd)
            {
                Tea[i].output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续查询信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y') Total();
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Poli_fun::Edit()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    poli_tea t;
    cout << "说出你想更改的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                            for (int j = 0; j < top; j++)
                            {
                                if (t.id == Tea[j].id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f) break;
                        }
                        if (t.sex == "男"&&Tea[i].sex != "男") Na++;
                        else if (t.sex != "男" && Tea[i].sex == "男") Na--;
                        Tea[i] = t;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                            for (int j = 0; j < top; j++)
                            {
                                if (t.id == Tea[j].id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f) break;
                        }
                        if (t.sex == "男"&&Tea[i].sex != "男") Na++;
                        else if (t.sex != "男" && Tea[i].sex == "男") Na--;
                        Tea[i] = t;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续修改信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y'||c == 'y')
        {
            Edit();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Poli_fun::Delete()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    poli_tea t;
    cout << "说出你想删除的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    cout << "        0.退出" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 0) return;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        for (; i < top; i++)
                            Tea[i] = Tea[i+1];
                        top--;
                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要删除的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        for (; i < top; i++)
                            Tea[i] = Tea[i+1];
                        top--;
                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续删除信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            Delete();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Poli_fun::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 a = 0, b = 0;
            for (int i = 0; i < top; i++)
            {
                if (Tea[i].sex == "男")a++;
                else b++;
            }
            cout << "先生人数:" << a <>Tea[i].id >>Tea[i].name >> Tea[i].age >> Tea[i].sex >> Tea[i].De_xi >> Tea[i].major >> Tea[i].post >> Tea[i].politics >> Tea[i].zpost)
    {
        if (Tea[i].sex == "男") Na++;
        i++;
        top++;
        TOP++;
    }
    ofcase.close();
}
#endif

Tea_fun.h

#ifndef TEA_H
#define TEA_H
#include  
#include 
#include 
#include "staff.h"
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
class teacher: virtual public staf
{
public:
    string De_xi, major, post;
    teacher():staf() {}
    void Input() //
    {
        staf::Input();
        cout << "系部:";
        cin >> De_xi;
        cout << "专业:";
        cin >> major;
        cout << "职位:";
        cin >> post;
    }
    void Input(const string &n)
    {
        staf::Input(n);
        cout << "系部:";
        cin >> De_xi;
        cout << "专业:";
        cin >> major;
        cout << "职位:";
        cin >> post;
    }
    void output()
    {
        staf::output();
        cout << "系部:" << De_xi << endl << "专业:" << major << endl << "职位:" << post << endl << endl;
    }
};
class Tea_fun :  virtual public teacher
{
    vector Tea;
    int top;
public:
    Tea_fun():teacher()
    {
        Tea.clear();
        top = 0;
        Read();
    }
    void Main1()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            char r,m,ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆___________________________教师成员信息管理系统_________________________◆\n";
            staf::MAIN();
            do
            {
                ch=getche();
            }
            while(ch>'3'||ch<'0');
            switch(ch)
            {
            case '1':
                Search();
                break;
            case '2':
                Show();
                break;
            case '3':
                Total();
                break;
            case '0':
                return;
            }
        }
    }
    void Main()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            char ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆___________________________教师成员信息管理系统_________________________◆\n";
            cout << "◆________________________________管理员模式______________________________◆\n";
            staf::vMain();
            do
            {
                ch=getche();
            }
            while(ch>'6'||ch<'0');
            switch(ch)
            {
            case '0':
                t = 0;
                break;
            case '1':
                add();
                break;
            case '2':
                Edit();
                break;
            case '3':
                Delete();
                break;
            case '4':
                Search();
                break;
            case '5':
                Show();
                break;
            case '6':
                Total();
                break;
            }
        }
    }
    void add();
    void Show();
    void Search();
    void Edit();
    void Delete();
    void Total();
    void Save();
    void Read();
    ~Tea_fun()
    {
        Save();
    }
};
void Tea_fun::add()
{
    char c;
    system("cls");
    if (top >= MAXX)
    {
        cout << "尊敬的用户抱歉,此系统该类信息已满!"<< endl << "无法在添加了!"<< endl;
        getche();
        return;
    }
    teacher t;
    string d;
    cout << "请输入你要添加的新教师:"<> d;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
    {
        if (d == (*i).id)
        {
            cout << "此用户编号已注册过!" << endl<< "是否要重新输入?(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    add();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    t.Input(d);
    Tea.push_back(t);
    TOP++;
    if (t.sex == "男") Na++;
    cout << "新用户添加成功!" << endl << "是否继续添加(Y/N): ";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            add();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
}
void Tea_fun::Show()
{
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
    {
        (*i).output();
    }
    cout << "按任意键返回";
    getche();
}
void Tea_fun::Search()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    cout << "        1.用编号查询" << endl << "        2.用姓名查询" << endl;
    cout << "        3.用相关信息查询" << endl;
    cout << "请输入你想操作的序号:" ;
    int s = 1;
    char k = '0';
    while (s)
    {
        k = getche();
        if (k == '1' || k == '2' || k == '3')
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == '2')
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
        {
            if ((*i).name == dd)
            {
                (*i).output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else
    {
        cout << "请输入你想要有关信息:";
        cin >> dd;
        bool flag = false;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
        {
            if ((*i).name == dd || (*i).age == dd || (*i).id == dd || (*i).major == dd || (*i).post == dd || (*i).De_xi == dd)
            {
                (*i).output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续查询信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            Search();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Tea_fun::Edit()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    teacher t;
    cout << "说出你想更改的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
        {
            if ((*i).id == dd)
            {
                (*i).output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                            vector::iterator j = Tea.begin();
                        for (; j != Tea.end(); j++)
                            {
                                if (t.id == (*j).id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f)
                            {
                                Tea.erase(j);
                                break;
                            }
                        }
                        if (t.sex == "男"&&(*i).sex != "男") Na++;
                        else if (t.sex != "男" && (*i).sex == "男") Na--;
                         Tea.push_back(t);
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
        {
            if ((*i).name == dd)
            {
                (*i).output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                    for (vector::iterator j = Tea.begin(); j != Tea.end(); j++)
                            {
                                if (t.id == (*j).id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f) break;
                        }
                        if (t.sex == "男"&&(*i).sex != "男") Na++;
                        else if (t.sex != "男" && (*i).sex == "男") Na--;
                        Tea.push_back(t);
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续修改信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y'||c == 'y')
        {
            Edit();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Tea_fun::Delete()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    teacher t;
    cout << "说出你想删除的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    cout << "        0.退出" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 0) return;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
        {
            if ((*i).id == dd)
            {
                (*i).output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        if ((*i).sex == "男") Na--;
                        Tea.erase(i);
                        top--;
                        TOP--;
                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要删除的名字:";
        cin >> dd;
        bool flag = false;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
        {
            if ((*i).name == dd)
            {
                (*i).output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        Tea.erase(i);
                        top--;
                        TOP--;
                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续删除信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            Delete();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Tea_fun::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 a = 0, b = 0;
    for (vector::iterator i = Tea.begin(); i != Tea.end(); i++)
            {
                if ((*i).sex == "男")a++;
                else b++;
            }
            cout << "先生人数:" << a <::iterator i = Tea.begin(); i != Tea.end(); i++)
    {
        ifcase<<(*i).id << " " <<(*i).name << " " << (*i).age << " " << (*i).sex << " " << (*i).De_xi << " " << (*i).major << " " <<(*i).post << endl;

    }
    ifcase.close();
}
void Tea_fun::Read()
{
    teacher t;
    ifstream ofcase("Tea.txt",ios::in|ios::binary);
    if(!ofcase) return;
    int i = 0;
    while (ofcase>>t.id >>t.name >> t.age >> t.sex >> t.De_xi >> t.major >> t.post)
    {
        if (t.sex == "男") Na++;
        i++;
        top++;
        TOP++;
        Tea.push_back(t);
    }
    ofcase.close();
//    getch();
}
#endif

Administrative.h

#ifndef Ad_H
#define Ad_H
#include 
#include 
#include "staff.h"
#include 
#include 
#include 
#include 
#include 
#include 
class Administrative : virtual public staf
{
public:
    string politics, post;
    Administrative():staf() {}
    void Input()
    {
        staf::Input();
        cout << "政治关系:";
        cin >> politics;
        cout << "职位:";
        cin >> post;
    }
    void Input(const string &n)
    {
        staf::Input(n);
        cout << "政治关系:";
        cin >> politics;
        cout << "职位:";
        cin >> post;
    }
    void output()
    {
        staf::output();
        cout << "政治关系:";
        cout << politics;
        cout << endl << "职位:";
        cout << post;
        cout << endl << endl;
    }
};
class Ad_fun :  virtual public Administrative
{
    Administrative Tea[MAXX];
    int top;
public:
    Ad_fun():Administrative()
    {
        top = 0;
        Read();
    }
    void Main1()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            char ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆_________________________行政人员成员信息管理系统_______________________◆\n";
            staf::MAIN();
            do
            {
                ch=getche();
            }
            while(ch>'3'||ch<'0');
            switch(ch)
            {
            case '1':
                Search();
                break;
            case '2':
                Show();
                break;
            case '3':
                Total();
                break;
            case '0':
                return;
            }
        }
    }
    void Main()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            system("color 03");
            char ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆___________________________行政成员信息管理系统_________________________◆\n";
            cout << "◆________________________________管理员模式______________________________◆\n";
            staf::vMain();
            do
            {
                ch=getche();
            }
            while(ch>'6'||ch<'0');
            switch(ch)
            {
            case '0':
                t = 0;
                break;
            case '1':
                add();
                break;
            case '2':
                Edit();
                break;
            case '3':
                Delete();
                break;
            case '4':
                Search();
                break;
            case '5':
                Show();
                break;
            case '6':
                Total();
                break;
            }
        }
    }
    void add();
    void Show();
    void Search();
    void Edit();
    void Delete();
    void Total();
    void Save();
    void Read();
    ~Ad_fun()
    {
        Save();
    }
};
void Ad_fun::add()
{
    char c;
    system("cls");
    if (top >= MAXX)
    {
        cout << "尊敬的用户抱歉,此系统该类信息已满!"<< endl << "无法在添加了!"<< endl;
        getche();
        return;
    }
    Administrative t;
    string d;
    cout << "请输入你要添加的新行政人员:"<< endl;
    cout << "编号:";
    cin >> d;
    for (int i = 0; i < top; i++)
    {
        if (d == Tea[i].id)
        {
            cout << "此用户编号已注册过!" << endl;
            cout << "是否要重新输入?" << endl;
            cout << "是(Y)" << " "  << "否(N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    add();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }

            }
        }
    }
    t.Input(d);
    Tea[top++] = t;
    TOP++;
    if (t.sex == "男") Na++;
    cout << "新用户添加成功!" << endl;
    cout << "是否继续添加(Y/N): ";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            add();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
}
void Ad_fun::Show()
{
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    for (int i = 0; i < top; i++)
    {
        Tea[i].output();
    }
    cout << "按任意键返回";
    getche();
}
void Ad_fun::Search()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }

    cout << "        1.用编号查询" << endl;
    cout << "        2.用姓名查询" << endl;
    cout << "        3.用相关信息查询" << endl;
    cout << "请输入你想操作的序号:"  ;
    int s = 1;
    char k = '0';
    while (s)
    {
        k = getche();
        if (k == '1' || k == '2' || k == '3')
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == '2')
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else
    {
        cout << "请输入你想要有关信息:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd || Tea[i].age == dd || Tea[i].id == dd || Tea[i].politics == dd || Tea[i].post == dd)
            {
                Tea[i].output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续查询信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y'||c == 'y')
        {
            Search();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Ad_fun::Edit()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    Administrative t;
    cout << "说出你想更改的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                            for (int j = 0; j < top; j++)
                            {
                                if (t.id == Tea[j].id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f) break;
                        }
                        if (t.sex == "男"&&Tea[i].sex != "男") Na++;
                        else if (t.sex != "男" && Tea[i].sex == "男") Na--;
                        Tea[i] = t;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                            for (int j = 0; j < top; j++)
                            {
                                if (t.id == Tea[j].id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f) break;
                        }
                        if (t.sex == "男"&&Tea[i].sex != "男") Na++;
                        else if (t.sex != "男" && Tea[i].sex == "男") Na--;
                        Tea[i] = t;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续修改信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y'||c == 'y')
        {
            Edit();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Ad_fun::Delete()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    Administrative t;
    cout << "说出你想删除的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    cout << "        0.退出" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 0) return;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        for (; i < top; i++)
                            Tea[i] = Tea[i+1];
                        top--;
                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要删除的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        for (; i < top; i++)
                            Tea[i] = Tea[i+1];
                        top--;
                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续删除信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            Delete();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Ad_fun::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 a = 0, b = 0;
            for (int i = 0; i < top; i++)
            {
                if (Tea[i].sex == "男")a++;
                else b++;
            }
            cout << "先生人数:" << a <>Tea[i].id >>Tea[i].name >> Tea[i].age >> Tea[i].sex >> Tea[i].politics >> Tea[i].post)
    {
        if (Tea[i].sex == "男") Na++;
        i++;
        top++;
        TOP++;
    }
    ofcase.close();
//    getch();
}
#endif

exp.h

#ifndef EXP_H
#define EXP_H
#include 
#include 
#include "staff.h"
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
class Experimenter : virtual public staf
{
public:
    string Laboratory, post;//实验室,职务;
    Experimenter():staf() {}
    void Input()
    {
        staf::Input();
        cout << endl << "实验室:";
        cin >> Laboratory;
        cout << endl << "职位:";
        cin >> post;
        cout << endl;
    }
    void Input(const string &n)
    {
        staf::Input(n);
        cout << endl << "实验室:";
        cin >> Laboratory;
        cout << endl << "职位:";
        cin >> post;
        cout << endl;
    }
    void output()
    {
        staf::output();
        cout << "实验室:";
        cout << Laboratory;
        cout << endl << "职位:";
        cout << post;
        cout << endl;
        cout << endl;
    }
};
class Exp_fun :  virtual public Experimenter
{
    Experimenter Tea[MAXX]; //TMAX为常量,为数组中可存储的教师记录的最大数;
    int top; // top表示当前系统中存储的记录个数

public:
    Exp_fun():Experimenter()
    {
        top = 0;    // top = 0;初始
        Read();
    }
    void Main1()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            system("color 03");
            char ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆_________________________行政人员成员信息管理系统_______________________◆\n";
            staf::MAIN();
            cout << "请输入你的指令:";
            do
            {
                ch=getche();
            }
            while(ch>'3'||ch<'0');
            switch(ch)
            {
            case '1':
                Search();
                break;
            case '2':
                Show();
                break;
            case '3':
                Total();
                break;
            case '0':
                return;
            }
        }
    }
    void Main()
    {
        int t = 1;
        while (t)
        {
            system("cls");
            system("color 03");
            char ch;
            cout << "◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆\n";
            cout << "◆__________________________实验员成员信息管理系统________________________◆\n";
            cout << "◆________________________________管理员模式______________________________◆\n";
            staf::vMain();
            do
            {
                ch=getche();
            }
            while(ch>'6'||ch<'0');
            switch(ch)
            {
            case '0':
                t = 0;
                break;
            case '1':
                add();
                break;
            case '2':
                Edit();
                break;
            case '3':
                Delete();
                break;
            case '4':
                Search();
                break;
            case '5':
                Show();
                break;
            case '6':
                Total();
                break;
            }
        }
    }
    void add();
    void Show();
    void Search();
    void Edit();
    void Delete();
    void Total();
    void Save();
    void Read();
    ~Exp_fun()
    {
        Save();
    }
};
void Exp_fun::add()
{
    char c;
    system("cls");
    if (top >= MAXX)
    {
        cout << "尊敬的用户抱歉,此系统该类信息已满!"<< endl << "无法在添加了!"<< endl;
        getche();
        return;
    }
    Experimenter t;
    string d;
    cout << "请输入你要添加的新实验员:"<< endl;
    cout << "编号:";
    cin >> d;
    for (int i = 0; i < top; i++)
    {
        if (d == Tea[i].id)
        {
            cout << "此用户编号已注册过!" << endl;
            cout << "是否要重新输入?(y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    add();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    t.Input(d);
    Tea[top++] = t;
    TOP++;
    if (t.sex == "男") Na++;
    cout << "新用户添加成功!" << endl;
    cout << "是否继续添加(Y/N): ";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            add();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
}
void Exp_fun::Show()
{
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    for (int i = 0; i < top; i++)
    {
        Tea[i].output();
    }
    cout << "按任意键返回";
    getche();
}
void Exp_fun::Search()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }

    cout << "        1.用编号查询" << endl;
    cout << "        2.用姓名查询" << endl;
    cout << "        3.用相关信息查询" << endl;
    cout << "请输入你想操作的序号:" ;
    int s = 1;
    char k = '0';
    while (s)
    {
        k = getche();
        if (k == '1' || k == '2' || k == '3')
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == '2')
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else
    {
        cout << "请输入你想要有关信息:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd || Tea[i].age == dd || Tea[i].id == dd || Tea[i].Laboratory == dd || Tea[i].post == dd)
            {
                Tea[i].output();
                flag = true;
                cout << endl;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Search();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续查询信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            Search();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Exp_fun::Edit()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    Experimenter t;
    cout << "说出你想更改的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                            for (int j = 0; j < top; j++)
                            {
                                if (t.id == Tea[j].id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f) break;
                        }
                        if (t.sex == "男"&&Tea[i].sex != "男") Na++;
                        else if (t.sex != "男" && Tea[i].sex == "男") Na--;
                        Tea[i] = t;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要查找的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                cout << "是否更改此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        cout << "请输入更改信息" << endl;
                        while (1)
                        {
                            bool f = true;
                            t.Input();
                            for (int j = 0; j < top; j++)
                            {
                                if (t.id == Tea[j].id&&i!=j)
                                {
                                    cout << "不好意思,此编号已存在。请重新输入。"<< endl;
                                    f = false;
                                    break;
                                }
                            }
                            if (f) break;
                        }
                        if (t.sex == "男"&&Tea[i].sex != "男") Na++;
                        else if (t.sex != "男" && Tea[i].sex == "男") Na--;
                        Tea[i] = t;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Edit();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Edit();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续修改信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y'||c == 'y')
        {
            Edit();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Exp_fun::Delete()
{
    char c;
    system("cls");
    if (top == 0)
    {
        cout << "无可用消息!请你添加!";
        getche();
        return;
    }
    Experimenter t;
    cout << "说出你想删除的编号或名字★";
    cout << "请输入你想操作的序号:"  << endl;
    cout << "        1.用编号查找" << endl;
    cout << "        2.用姓名查找" << endl;
    cout << "        0.退出" << endl;
    int s = 1,k = 0;
    cout << "我们会高效完成你的指令:";
    while (s)
    {
        cin >> k;
        if (k == 0) return;
        if (k == 1 || k == 2)
            s = 0;
        else
        {
            cout << "你的输入错误,请你重新输入!" <> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].id == dd)
            {
                Tea[i].output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        if (Tea[i].sex == "男") Na--;
                        for (; i < top; i++)
                            Tea[i] = Tea[i+1];
                        top--;
                        TOP--;

                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    else if (k == 2)
    {
        cout << "请输入你想要删除的名字:";
        cin >> dd;
        bool flag = false;
        for (int i = 0; i < top; i++)
        {
            if (Tea[i].name == dd)
            {
                Tea[i].output();
                cout << "是否删除此条信息?(Y/N)" << endl;
                while (1)
                {
                    c = getche();
                    cout << endl;
                    if (c == 'Y'||c == 'y')
                    {
                        for (; i < top; i++)
                            Tea[i] = Tea[i+1];
                        top--;
                        cout << "删除成功!" << endl;
                        break;
                    }
                    else if (c == 'N'||c == 'n')
                    {
                        Delete();
                        return;
                    }
                    else
                    {
                        cout << "输入格式错误!请重新输入" << endl;
                    }
                }
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            cout << "不好意是没有此人信息:" << endl;
            cout << "是否重新输入(Y/N)" << endl;
            while (1)
            {
                c = getche();
                cout << endl;
                if (c == 'Y'||c == 'y')
                {
                    Delete();
                    return;
                }
                else if (c == 'N'||c == 'n') return;
                else
                {
                    cout << "输入格式错误!请重新输入" << endl;
                }
            }
        }
    }
    cout << "是否继续删除信息(Y/N):";
    while (1)
    {
        c = getche();
        cout << endl;
        if (c == 'Y' || c == 'y')
        {
            Delete();
            return;
        }
        else if (c == 'N'|| c == 'n') return;
        else cout << "你的命令姿势不对,换个姿势试试!" << endl;
    }
    getche();
}
void Exp_fun::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 a = 0, b = 0;
            for (int i = 0; i < top; i++)
            {
                if (Tea[i].sex == "男")a++;
                else b++;
            }
            cout << "先生人数:" << a <>Tea[i].id >>Tea[i].name >> Tea[i].age >> Tea[i].sex >> Tea[i].Laboratory >> Tea[i].post)
    {
        if (Tea[i].sex == "男") Na++;
        i++;
        top++;
        TOP++;

    }
    ofcase.close();
//    getch();
}
#endif

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;
}

你可能感兴趣的:(课程设计作业)