#include <iostream>
#include <string>
using namespace std;

// 教师类（基类1）
class Teacher {
protected:
    // 公共数据成员：姓名、年龄、性别、地址、电话
    string name;
    int age;
    string sex;
    string addr;
    string phone;
    string title;  // 职称（教师独有）
public:
    // 构造函数声明
    Teacher(string n, int a, string s, string ad, string p, string t);
    // 显示信息函数声明
    void display();
};

// 干部类（基类2）
class Cadre {
protected:
    // 公共数据成员（与Teacher类同名）
    string name;
    int age;
    string sex;
    string addr;
    string phone;
    string post;  // 职务（干部独有）
public:
    // 构造函数声明
    Cadre(string n, int a, string s, string ad, string p, string po);
};

// 教师干部类（多重继承派生类）
class Teacher_Cadre : public Teacher, public Cadre {
private:
    float wages;  // 工资（派生类独有）
public:
    // 构造函数声明
    Teacher_Cadre(string n, int a, string s, string ad, string p, string t, string po, float w);
    // 显示信息函数声明
    void show();
};

// ==================== 类外实现成员函数 ====================
// Teacher类构造函数
Teacher::Teacher(string n, int a, string s, string ad, string p, string t) {
    name = n;
    age = a;
    sex = s;
    addr = ad;
    phone = p;
    title = t;
}

// Teacher类显示函数
void Teacher::display() {
    cout << "姓名：" << name << endl;
    cout << "年龄：" << age << endl;
    cout << "性别：" << sex << endl;
    cout << "职称：" << title << endl;
    cout << "地址：" << addr << endl;
    cout << "电话：" << phone << endl;
}

// Cadre类构造函数
Cadre::Cadre(string n, int a, string s, string ad, string p, string po) {
    name = n;
    age = a;
    sex = s;
    addr = ad;
    phone = p;
    post = po;
}

// Teacher_Cadre类构造函数（解决同名成员，指定作用域初始化）
Teacher_Cadre::Teacher_Cadre(string n, int a, string s, string ad, string p, string t, string po, float w)
    : Teacher(n, a, s, ad, p, t), Cadre(n, a, s, ad, p, po) {
    wages = w;  // 初始化工资
}

// Teacher_Cadre类显示函数（调用基类display，指定作用域访问同名成员）
void Teacher_Cadre::show() {
    // 调用教师类的display函数，输出基础信息+职称
    Teacher::display();
    // 直接输出职务（来自Cadre类）和工资
    cout << "职务：" << Cadre::post << endl;
    cout << "工资：" << wages << "元" << endl;
}

// ==================== 主函数测试 ====================
int main() {
    // 创建教师干部对象
    Teacher_Cadre tc("张三", 40, "男", "北京市海淀区", "13800138000", "副教授", "系主任", 8500.50);
    
    // 调用显示函数
    tc.show();
    return 0;
}