C++課程設計——大学人員情報管理システム


コードは臭くて長いです.BUGがあれば、指摘してください.必ずしも変更するとは限りません.ಥ
common.h共有クラス:
#ifndef COMMON_H_INCLUDED
#define COMMON_H_INCLUDED

#include
#include
#include

class COMMON
{
protected:
    std::string name;
    bool sex;
    int age;
    std::string id;
    static int person_sum;
    static int man_sum;
    static int woman_sum;
public:
    COMMON(std::string a, bool b, int c, std::string d);
    virtual ~COMMON();
    static int get_person_sum();
    static int get_man_sum();
    static int get_woman_sum();
    virtual void show(){}
    virtual void show_row(){}
    virtual bool change(){}

    std::string get_name(){return name;}
    bool get_sex(){return sex;}
    int get_age(){return age;}
    std::string get_id(){return id;}
};

int COMMON::person_sum = 0;
int COMMON::man_sum = 0;
int COMMON::woman_sum = 0;

int COMMON::get_person_sum()
{
    return person_sum;
}

int COMMON::get_man_sum()
{
    return man_sum;
}

int COMMON::get_woman_sum()
{
    return woman_sum;
}

COMMON::COMMON(std::string a, bool b, int c, std::string d): name(a), sex(b), age(c), id(d)
{
    person_sum++;
    if(b) man_sum++;
    else woman_sum++;
}

COMMON::~COMMON()
{
    person_sum--;
    if(sex) man_sum--;
    else woman_sum--;
}

#endif // COMMON_H_INCLUDED

tester.h実験員:
#ifndef TESTER_H_INCLUDED
#define TESTER_H_INCLUDED

#include"common.h"

class TESTER: public COMMON
{
private:
    std::string laboratory;
    std::string title;
    static int tester_sum;
public:
    TESTER(std::string a = "haha", bool b = 1, int c = 19, std::string d = "1",
           std::string e = "tt", std::string f = "  ");
    ~TESTER();

    static int get_tester_sum();
    virtual void show();
    virtual void show_row();
    virtual bool change();

    std::string get_laboratory(){return laboratory;}
    std::string get_title(){return title;}
};

int TESTER::tester_sum = 0;

int TESTER::get_tester_sum()
{
    return tester_sum;
}

TESTER::TESTER(std::string a, bool b, int c, std::string d, std::string e, std::string f):
COMMON(a,b,c,d), laboratory(e), title(f)
{
    tester_sum++;
}

TESTER::~TESTER()
{
    tester_sum--;
}

void TESTER::show()
{
    std::cout << "   :
"; std::cout << " :\t\t" << name << std::endl; std::cout << " :\t\t"; if(sex) std::cout << "
"; else std::cout << "
"; std::cout << " :\t\t" << age << std::endl; std::cout << "ID:\t\t" << id << std::endl; std::cout << " :\t" << laboratory << std::endl; std::cout << " :\t\t" << title << std::endl; } void TESTER::show_row() { std::cout << std::left << std::setw(8) << name; if(sex) std::cout << std::left << std::setw(8) << " "; else std::cout << std::left << std::setw(8) << " "; std::cout << std::left << std::setw(8) << age; std::cout << std::left << std::setw(16) << id; std::cout << std::left << std::setw(16) << laboratory; std::cout << std::left << std::setw(16) << title; std::cout << std::endl; } bool TESTER::change() { std::cout << " :\t\t" ; std::string new_name; std::cin >> new_name; for(unsigned int i = 0; i < new_name.length(); i++) { if(new_name[i] >= '0' && new_name[i] <= '9') { std::cout << " ,
"; return 1; } } name = new_name; std::cout << " :\t\t"; std::string a; std::cin >> a; if(sex) man_sum--; else woman_sum--; if(a == " ") sex = 1, man_sum++; else sex = 0, woman_sum++; std::cout << " :\t\t"; std::cin >> age; std::cout << " :\t"; std::cin >> laboratory; std::cout << " :\t\t"; std::cin >> title; return 0; } #endif // TESTER_H_INCLUDED

teacher.h先生:
#ifndef TEACHER_H_INCLUDED
#define TEACHER_H_INCLUDED

#include"common.h"

class TEACHER: virtual public COMMON
{
protected:
    std::string department;
    std::string profession;
    std::string title;
    static int teacher_sum;
public:
    TEACHER(std::string a = "xixi", bool b = 1, int c = 30, std::string d = "213",
            std::string e = "          ", std::string f = "        ", std::string g = "  ");
    ~TEACHER();

    static int get_teacher_sum();
    virtual void show();
    virtual void show_row();
    virtual bool change();

    std::string get_department(){return department;}
    std::string get_profession(){return profession;}
    std::string get_title(){return title;}
};

int TEACHER::teacher_sum = 0;

int TEACHER::get_teacher_sum()
{
    return teacher_sum;
}

TEACHER::TEACHER(std::string a, bool b, int c, std::string d, std::string e, std::string f, std::string g):
COMMON(a,b,c,d), department(e), profession(f), title(g)
{
    teacher_sum++;
}

TEACHER::~TEACHER()
{
    teacher_sum--;
}

void TEACHER::show()
{
    std::cout << "  :
"; std::cout << " :\t\t" << name << std::endl; std::cout << " :\t\t"; if(sex) std::cout << "
"; else std::cout << "
"; std::cout << " :\t\t" << age << std::endl; std::cout << "ID:\t\t" << id << std::endl; std::cout << " :\t\t" << department << std::endl; std::cout << " :\t\t" << profession << std::endl; std::cout << " :\t\t" << title << std::endl; } void TEACHER::show_row() { std::cout << std::left << std::setw(8) << name; if(sex) std::cout << std::left << std::setw(8) << " "; else std::cout << std::left << std::setw(8) << " "; std::cout << std::left << std::setw(8) << age; std::cout << std::left << std::setw(16) << id; std::cout << std::left << std::setw(16) << department; std::cout << std::left << std::setw(16) << profession; std::cout << std::left << std::setw(16) << title; std::cout << std::endl; } bool TEACHER::change() { std::cout << " :\t\t" ; std::string new_name; std::cin >> new_name; for(unsigned int i = 0; i < new_name.length(); i++) { if(new_name[i] >= '0' && new_name[i] <= '9') { std::cout << " ,
"; return 1; } } name = new_name; std::cout << " :\t\t"; std::string a; std::cin >> a; if(sex) man_sum--; else woman_sum--; if(a == " ") sex = 1, man_sum++; else sex = 0, woman_sum++; std::cout << " :\t\t"; std::cin >> age; std::cout << " :\t\t"; std::cin >> department; std::cout << " :\t\t"; std::cin >> profession; std::cout << " :\t\t"; std::cin >> title; return 0; } #endif // TEACHER_H_INCLUDED

administrator.h行政人員:
#ifndef ADMINISTRATOR_H_INCLUDED
#define ADMINISTRATOR_H_INCLUDED

#include"common.h"

class ADMINISTRATOR: virtual public COMMON
{
protected:
    std::string politics;
    std::string position;
    static int administrator_sum;
public:
    ADMINISTRATOR(std::string a = "huhu", bool b = 1, int c = 39, std::string d = "176",
                  std::string e = "  ", std:: string f = "       ");
    ~ADMINISTRATOR();

    static int get_administrator_sum();
    virtual void show();
    virtual void show_row();
    virtual bool change();

    std::string get_politics(){return politics;}
    std::string get_position(){return position;}
};

int ADMINISTRATOR::administrator_sum = 0;

int ADMINISTRATOR::get_administrator_sum()
{
    return administrator_sum;
}

ADMINISTRATOR::ADMINISTRATOR(std::string a, bool b, int c, std::string d, std::string e, std::string f):
COMMON(a,b,c,d), politics(e), position(f)
{
    administrator_sum++;
}

ADMINISTRATOR::~ADMINISTRATOR()
{
    administrator_sum--;
}

void ADMINISTRATOR::show()
{
    std::cout << "    :
"; std::cout << " :\t\t" << name << std::endl; std::cout << " :\t\t"; if(sex) std::cout << "
"; else std::cout << "
"; std::cout << " :\t\t" << age << std::endl; std::cout << "ID:\t\t" << id << std::endl; std::cout << " :\t" << politics << std::endl; std::cout << " :\t\t" << position << std::endl; } void ADMINISTRATOR::show_row() { std::cout << std::left << std::setw(8) << name; if(sex) std::cout << std::left << std::setw(8) << " "; else std::cout << std::left << std::setw(8) << " "; std::cout << std::left << std::setw(8) << age; std::cout << std::left << std::setw(16) << id; std::cout << std::left << std::setw(16) << politics; std::cout << std::left << std::setw(16) << position; std::cout << std::endl; } bool ADMINISTRATOR::change() { std::cout << " :\t\t" ; std::string new_name; std::cin >> new_name; for(unsigned int i = 0; i < new_name.length(); i++) { if(new_name[i] >= '0' && new_name[i] <= '9') { std::cout << " ,
"; return 1; } } name = new_name; std::cout << " :\t\t"; std::string a; std::cin >> a; if(sex) man_sum--; else woman_sum--; if(a == " ") sex = 1, man_sum++; else sex = 0, woman_sum++; std::cout << " :\t\t"; std::cin >> age; std::cout << " :\t"; std::cin >> politics; std::cout << " :\t\t"; std::cin >> position; return 0; } #endif // ADMINISTRATOR_H_INCLUDED

tea&admi.h教師及び行政人員:
#ifndef TEAADMI_H_INCLUDED
#define TEAADMI_H_INCLUDED

#include"teacher.h"
#include"administrator.h"

class TEAADMI: public TEACHER, public ADMINISTRATOR
{
private:
    static int teaadmi_sum;
public:
    TEAADMI(std::string a = "maomao", bool b = 1, int c = 59, std::string d = "0",
            std::string e = "          ", std::string f = "        ", std::string g = "  ",
            std::string h = "  ", std:: string i = "       ");
    ~TEAADMI();
    static int get_teaadmi_sum();
    virtual void show();
    virtual void show_row();
    virtual bool change();
};

int TEAADMI::teaadmi_sum = 0;

int TEAADMI::get_teaadmi_sum()
{
    return teaadmi_sum;
}

TEAADMI::TEAADMI(std::string a, bool b, int c, std::string d, std::string e, std::string f, std::string g, std::string h, std::string i):
COMMON(a,b,c,d), TEACHER(a,b,c,d,e,f,g), ADMINISTRATOR(a,b,c,d,h,i)
{
    teaadmi_sum++;
}

TEAADMI::~TEAADMI()
{
    teaadmi_sum--;
}

void TEAADMI::show()
{
    std::cout << "       :
"; std::cout << " :\t\t" << name << std::endl; std::cout << " :\t\t"; if(sex) std::cout << "
"; else std::cout << "
"; std::cout << " :\t\t" << age << std::endl; std::cout << "ID:\t\t" << id << std::endl; std::cout << " :\t\t" << department << std::endl; std::cout << " :\t\t" << profession << std::endl; std::cout << " :\t\t" << title << std::endl; std::cout << " :\t" << politics << std::endl; std::cout << " :\t\t" << position << std::endl; } void TEAADMI::show_row() { std::cout << std::left << std::setw(8) << name; if(sex) std::cout << std::left << std::setw(8) << " "; else std::cout << std::left << std::setw(8) << " "; std::cout << std::left << std::setw(8) << age; std::cout << std::left << std::setw(16) << id; std::cout << std::left << std::setw(16) << department; std::cout << std::left << std::setw(16) << profession; std::cout << std::left << std::setw(16) << title; std::cout << std::left << std::setw(16) << politics; std::cout << std::left << std::setw(16) << position; std::cout << std::endl; } bool TEAADMI::change() { std::cout << " :\t\t" ; std::string new_name; std::cin >> new_name; for(unsigned int i = 0; i < new_name.length(); i++) { if(new_name[i] >= '0' && new_name[i] <= '9') { std::cout << " ,
"; return 1; } } name = new_name; std::cout << " :\t\t"; std::string a; std::cin >> a; if(sex) man_sum--; else woman_sum--; if(a == " ") sex = 1, man_sum++; else sex = 0, woman_sum++; std::cout << " :\t\t"; std::cin >> age; std::cout << " :\t\t"; std::cin >> department; std::cout << " :\t\t"; std::cin >> profession; std::cout << " :\t\t"; std::cin >> title; std::cout << " :\t"; std::cin >> politics; std::cout << " :\t\t"; std::cin >> position; return 0; } #endif // TEA&ADMI_H_INCLUDED

interface.hインタフェース:
#ifndef INTERFACE_H_INCLUDED
#define INTERFACE_H_INCLUDED

#include"teacher.h"
#include"tester.h"
#include"administrator.h"
#include"tea&admi.h"

#include
#include
#include

/*----------------    -------------------*/

void interface_login();          //    
void interface_Manager();        //     
void staff_list();               //     

#include"myfun.h"

/*----------------    -------------------*/

void interface_Manager() //    
{
    int n=1;
    while(n)
    {
        system("cls");
        std::cout << "------------             o(*≧▽≦)ツ----------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "------------- 1 -------------
"; std::cout << "------------- 2 -------------
"; std::cout << "------------- 3 -------------
"; std::cout << "------------- 4 -------------
"; std::cout << "------------- 5 -------------
"; std::cout << "------------- 6 -------------
"; std::cout << "------------- 0 -------------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "-----------------------------------------------------------
"; std::cin >> n; switch(n) { case 1:Add_information();break; case 2: { int a = 1; if(!Query_information()) break; while(a) { std::cout << " 1
"; std::cout << " 2
"; std::cout << " 0
"; std::cin >> a; switch(a) { case 1:Edit_information(); a = 0; break; case 2:Delete_information(); a= 0; break; } } break; } case 3: { int a=1; while(a) { Browse_information(); std::cout << " 1
"; std::cout << " 2
"; std::cout << " 0
"; std::cin >> a; switch(a) { case 1:Edit_information(); break; case 2:Delete_information(); break; } } break; } case 4:Edit_information(); break; case 5:Delete_information(); break; case 6:count_information(); break; } } } void interface_login() // { int n=1; while(n) { system("cls"); std::cout << "---------- o(*≧▽≦)ツ--------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "------------- 1 -------------
"; std::cout << "------------- 2 -------------
"; std::cout << "------------- 3 -------------
"; std::cout << "------------- 4 -------------
"; std::cout << "------------- 5 -------------
"; std::cout << "------------- 0 -------------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "-----------------------------------------------------------
"; std::cin >> n; switch(n) { case 1:login(); break; case 2:if(Query_information()) std::cout << " ,
", getch(); break; case 3:Browse_information(); std::cout << " ,
"; getch(); break; case 4:count_information(); break; case 5:staff_list(); break; } } } void staff_list() // { system("cls"); std::cout << "-----------------------------------------------------------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "--------------Include the following members----------------
"; std::cout << "-------------- wzy ----------------
"; std::cout << "-------------- ToRe ----------------
"; std::cout << "-----------------------------------------------------------
"; std::cout << "-----------------------------------------------------------


"; std::cout << "

"; getch(); } #endif // INTERFACE_H_INCLUDED

myfun.h主な機能実現:
#ifndef MYFUN_H_INCLUDED
#define MYFUN_H_INCLUDED

#include
#include
#include

/*----------------    -------------------*/

std::multimap<:string common=""> sear;

std::vector tester;
std::vector teacher;
std::vector administrator;
std::vector teaadmi;

/*----------------    -------------------*/

void Information_load();        //    
void room_delete();             //    
void login();                   //    
void Add_information();         //    
bool Query_information();       //      
void Browse_information();      //    
void Edit_information();        //    
void Delete_information();      //    
void count_information();       //    

/*----------------    -------------------*/

void Information_load() //    
{
    std::ifstream in;
    in.open("   .txt", std::ios::in);
    std::string name, id;
    int age;
    bool sex;
    while(in >> name)
    {
        std::string laboratory, title;
        in >> sex >> age >> id >> laboratory >> title;
        TESTER *t = new TESTER(name,sex,age,id,laboratory,title);
        tester.push_back(t);
        sear.insert(make_pair(name, t));
        sear.insert(make_pair(id, t));
    }
    in.close();

    in.open("  .txt", std::ios::in);
    while(in >> name)
    {
        std::string department, profession, title;
        in >> sex >> age >> id >> department >> profession >> title;
        TEACHER *t = new TEACHER(name,sex,age,id,department,profession,title);
        teacher.push_back(t);
        sear.insert(make_pair(name, t));
        sear.insert(make_pair(id, t));
    }
    in.close();

    in.open("    .txt", std::ios::in);
    while(in >> name)
    {
        std::string politics, position;
        in >> sex >> age >> id >> politics >> position;
        ADMINISTRATOR *t = new ADMINISTRATOR(name,sex,age,id,politics,position);
        administrator.push_back(t);
        sear.insert(make_pair(name, t));
        sear.insert(make_pair(id, t));
    }
    in.close();

    in.open("  &    .txt", std::ios::in);
    while(in >> name)
    {
        std::string department, profession, title, politics, position;
        in >> sex >> age >> id >> department >> profession >> title >> politics >> position;
        TEAADMI *t = new TEAADMI(name,sex,age,id,department,profession,title,politics,position);
        teaadmi.push_back(t);
        sear.insert(make_pair(name, t));
        sear.insert(make_pair(id, t));
    }
}

void room_delete() //    
{
    for(auto iter:tester) delete iter;
    for(auto iter:teacher) delete iter;
    for(auto iter:administrator) delete iter;
    for(auto iter:teaadmi) delete iter;
}

void login() //    
{
    std::string com;
    system("cls");
    std::cout << "     
"; getchar(); std::getline(std::cin,com); if(com == "bokuwasinnsekainokamitonaru") interface_Manager(); else { std::cout << " ,
"; getch(); } } void Add_information()// { system("cls"); std::cout << "
1: \t2: \t\t3: \t4:
"; int flag; std::cin >> flag; std::string name, se, id; int age; bool sex = 0; std::cout << "ID:\t\t"; std::cin >> id; for(unsigned int i = 0; i < id.length(); i++) { if(id[i] < '0' || id[i] > '9') { std::cout << " ,
"; getch(); return; } } std::multimap<:string common="">::iterator beg, en; beg = sear.lower_bound(id); en = sear.upper_bound(id); if(beg != en) { std::cout << " ID ,
"; getch(); return; } std::cout << " :\t\t"; std::cin >> name; for(unsigned int i = 0; i < name.length(); i++) { if(name[i] >= '0' && name[i] <= '9') { std::cout << " ,
"; getch(); return; } } std::cout << " :\t\t"; std::cin >> se; if(se == " ") sex = 1; std::cout << " :\t\t"; std::cin >> age; if(flag == 1) { std::string laboratory, title; std::cout << " :\t"; std::cin >> laboratory; std::cout << " :\t\t"; std::cin >> title; TESTER *t = new TESTER(name,sex,age,id,laboratory,title); tester.push_back(t); sear.insert(make_pair(name, t)); sear.insert(make_pair(id, t)); std::ofstream out; out.open(" .txt", std::ios::app); out << name << " " << sex << " " << age << " " << id << " "; out << laboratory << " " << title << std::endl; out.close(); } if(flag == 2) { std::string department, profession, title; std::cout << " :\t\t"; std::cin >> department; std::cout << " :\t\t"; std::cin >> profession; std::cout << " :\t\t"; std::cin >> title; TEACHER *t = new TEACHER(name,sex,age,id,department,profession,title); teacher.push_back(t); sear.insert(make_pair(name, t)); sear.insert(make_pair(id, t)); std::ofstream out; out.open(" .txt", std::ios::app); out << name << " " << sex << " " << age << " " << id << " "; out << department << " " << profession << " " << title << std::endl; out.close(); } if(flag == 3) { std::string politics, position; std::cout << " :\t"; std::cin >> politics; std::cout << " :\t\t"; std::cin >> position; ADMINISTRATOR *t = new ADMINISTRATOR(name,sex,age,id,politics,position); administrator.push_back(t); sear.insert(make_pair(name, t)); sear.insert(make_pair(id, t)); std::ofstream out; out.open(" .txt", std::ios::app); out << name << " " << sex << " " << age << " " << id << " "; out << politics << " " << position << std::endl; out.close(); } if(flag == 4) { std::string department, profession, title, politics, position; std::cout << " :\t\t"; std::cin >> department; std::cout << " :\t\t"; std::cin >> profession; std::cout << " :\t\t"; std::cin >> title; std::cout << " :\t"; std::cin >> politics; std::cout << " :\t\t"; std::cin >> position; TEAADMI *t = new TEAADMI(name,sex,age,id,department,profession,title,politics,position); teaadmi.push_back(t); sear.insert(make_pair(name, t)); sear.insert(make_pair(id, t)); std::ofstream out; out.open(" & .txt", std::ios::app); out << name << " " << sex << " " << age << " " << id << " "; out << department << " " << profession << " " << title << " "; out << politics << " " << position << std::endl; out.close(); } std::cout << " ,
"; getch(); } void Delete_information() // { std::cout << " ID
"; std::string aid; std::cin >> aid; for(unsigned int i = 0; i < aid.length(); i++) { if(aid[i] < '0' || aid[i] > '9') { std::cout << " ,
"; getch(); return; } } std::multimap<:string common="">::iterator beg, en, iter; beg = sear.lower_bound(aid); en = sear.upper_bound(aid); if(beg == en) { std::cout << " ,
"; getch(); return; } std::string aid_name = beg -> second -> get_name(); sear.erase(beg); beg = sear.lower_bound(aid_name); en = sear.upper_bound(aid_name); for(iter = beg; iter != en; ++iter) if(iter -> second -> get_id() == aid) {sear.erase(iter); break;} bool flag = 0; std::ofstream out; out.open(" .txt", std::ios::out); for(std::vector::iterator it = tester.begin(); it != tester.end();) { if((*it) -> get_id() == aid){flag = 1; delete (*it); it = tester.erase(it); continue;} out << (*it) -> get_name() << " " << (*it) -> get_sex() << " "; out << (*it) -> get_age() << " " << (*it) -> get_id() << " "; out << (*it) -> get_laboratory() << " " << (*it) -> get_title() << std::endl; ++it; } out.close(); if(flag) {std::cout << " ,
"; getch(); return;} out.open(" .txt", std::ios::out); for(std::vector::iterator it = teacher.begin(); it != teacher.end();) { if((*it) -> get_id() == aid){flag = 1; delete (*it); it = teacher.erase(it); continue;} out << (*it) -> get_name() << " " << (*it) -> get_sex() << " "; out << (*it) -> get_age() << " " << (*it) -> get_id() << " "; out << (*it) -> get_department() << " " << (*it) -> get_profession() << " " << (*it) -> get_title() << std::endl; it++; } out.close(); if(flag) {std::cout << " ,
"; getch(); return;} out.open(" .txt", std::ios::out); for(std::vector::iterator it = administrator.begin(); it != administrator.end();) { if((*it) -> get_id() == aid){flag = 1; delete (*it); it = administrator.erase(it); continue;} out << (*it) -> get_name() << " " << (*it) -> get_sex() << " "; out << (*it) -> get_age() << " " << (*it) -> get_id() << " "; out << (*it) -> get_politics() << " " << (*it) -> get_position() << std::endl; it++; } out.close(); if(flag) {std::cout << " ,
"; getch(); return;} out.open(" & .txt", std::ios::out); for(std::vector::iterator it = teaadmi.begin(); it != teaadmi.end();) { if((*it) -> get_id() == aid){flag = 1; delete (*it); it = teaadmi.erase(it); continue;} out << (*it) -> get_name() << " " << (*it) -> get_sex() << " "; out << (*it) -> get_age() << " " << (*it) -> get_id() << " "; out << (*it) -> get_department() << " " << (*it) -> get_profession() << " " << (*it) -> get_title() << " "; out << (*it) -> get_politics() << " " << (*it) -> get_position() << std::endl; ++it; } out.close(); std::cout << " ,
"; getch(); } void Edit_information() // { std::cout << " ID
"; std::string aid; std::cin >> aid; for(unsigned int i = 0; i < aid.length(); i++) { if(aid[i] < '0' || aid[i] > '9') { std::cout << " ,
"; getch(); return; } } std::multimap<:string common="">::iterator beg, en, iter; beg = sear.lower_bound(aid); en = sear.upper_bound(aid); if(beg == en) { std::cout << " ,
"; getch(); return; } system("cls"); bool flag = 0; std::ofstream out; out.open(" .txt", std::ios::out); for(auto iter:tester) { if(iter -> get_id() == aid) { iter -> show(), std::cout << "



"; while(iter -> change()) { system("cls"); iter -> show(); std::cout << " ,
"; } flag = 1; } out << iter -> get_name() << " " << iter -> get_sex() << " "; out << iter -> get_age() << " " << iter -> get_id() << " "; out << iter -> get_laboratory() << " " << iter -> get_title() << std::endl; } out.close(); if(flag) {std::cout << " ,
"; getch(); return;} out.open(" .txt", std::ios::out); for(auto iter:teacher) { if(iter -> get_id() == aid) { iter -> show(), std::cout << "



"; while(iter -> change()) { system("cls"); iter -> show(); std::cout << " ,
"; } flag = 1; } out << iter -> get_name() << " " << iter -> get_sex() << " "; out << iter -> get_age() << " " << iter -> get_id() << " "; out << iter -> get_department() << " " << iter -> get_profession() << " " << iter -> get_title() << std::endl; } out.close(); if(flag) {std::cout << " ,
"; getch(); return;} out.open(" .txt", std::ios::out); for(auto iter:administrator) { if(iter -> get_id() == aid) { iter -> show(), std::cout << "



"; while(iter -> change()) { system("cls"); iter -> show(); std::cout << " ,
"; } flag = 1; } out << iter -> get_name() << " " << iter -> get_sex() << " "; out << iter -> get_age() << " " << iter -> get_id() << " "; out << iter -> get_politics() << " " << iter -> get_position() << std::endl; } out.close(); if(flag) {std::cout << " ,
"; getch(); return;} out.open(" & .txt", std::ios::out); for(auto iter:teaadmi) { if(iter -> get_id() == aid) { iter -> show(), std::cout << "



"; while(iter -> change()) { system("cls"); iter -> show(); std::cout << " ,
"; } flag = 1; } out << iter -> get_name() << " " << iter -> get_sex() << " "; out << iter -> get_age() << " " << iter -> get_id() << " "; out << iter -> get_department() << " " << iter -> get_profession() << " " << iter -> get_title() << " "; out << iter -> get_politics() << " " << iter -> get_position() << std::endl; } out.close(); std::cout << " ,
"; getch(); } bool Query_information() // { system("cls"); std::cout << " ID
"; std::string aid; std::cin >> aid; std::multimap<:string common="">::iterator beg, en, iter; beg = sear.lower_bound(aid); en = sear.upper_bound(aid); if(beg == en) { std::cout << " ,
"; getch(); return 0; } for(iter = beg; iter != en; ++iter) { iter -> second -> show(); std::cout << std::endl; } return 1; } void Browse_information() // { system("cls"); std::cout << "------------------- -------------------
"; std::cout << " \t" << " \t" << " \t" << "ID\t\t" << " \t" << "
"; for(auto iter:tester) iter -> show_row(); std::cout << "
------------------ ------------------
"; std::cout << " \t" << " \t" << " \t" << "ID\t\t" << " \t" << "
"; for(auto iter:administrator) iter -> show_row(); std::cout << "
-------------------- --------------------
"; std::cout << " \t" << " \t" << " \t" << "ID\t\t" << " \t\t" << " \t\t" << "
"; for(auto iter:teacher) iter -> show_row(); std::cout << "
----------------- & --------------
"; std::cout << " \t" << " \t" << " \t" << "ID\t\t" << " \t" << " \t\t" << " \t\t" << " \t\t" << "
"; for(auto iter:teaadmi) iter -> show_row(); } void count_information() // { system("cls"); std::cout << " :\t\t" << COMMON::get_person_sum() << std::endl; std::cout << " :\t\t" << COMMON::get_man_sum() << std::endl; std::cout << " :\t\t" << COMMON::get_woman_sum() << std::endl; std::cout << " :\t\t" << TEACHER::get_teacher_sum() << std::endl; std::cout << " :\t\t" << TESTER::get_tester_sum() << std::endl; std::cout << " :\t" << ADMINISTRATOR::get_administrator_sum() << std::endl; std::cout << " & :\t" << TEAADMI::get_teaadmi_sum() << std::endl; std::cout << "


"; getch(); } #endif // MYFUN_H_INCLUDED

main.cpp主関数:
#include"interface.h"

int main()
{
    Information_load(); //    
    interface_login(); //   
    room_delete(); //    
//    count_information();
    return 0;
}