/*Copyright (c) 2016, 烟台大学计算机学院
*All rights reserved.
*文件名称:c11weeks.cpp
*作者:王帅
*版本号:vc++6.0
*/
#include <iostream>
using namespace std;
class Teacher
{
private:
string name;
int age;
char sex;
string addr;
string tell;
string title;
public:
Teacher(string na,int ag,char se,string add,string tel,string tit):name(na),age(ag),sex(se),addr(add),tell(tel),title(tit){}
void display()
{
cout<<name<<endl;
cout<<age<<endl;
cout<<sex<<endl;
cout<<addr<<endl;
cout<<tell<<endl;
cout<<title<<endl;
}
};
class Cadre
{
protected:
string name;
int age;
char sex;
string addr;
string tell;
string post;
public:
Cadre(string na,int ag,char se,string add,string tel,string po):name(na),age(ag),sex(se),addr(add),tell(tel),post(po){}
void display()
{
cout<<name<<endl;
cout<<age<<endl;
cout<<sex<<endl;
cout<<addr<<endl;
cout<<tell<<endl;
cout<<post<<endl;
}
};
class Teacher_Cadre:public Teacher,public Cadre
{
private:
float wages;
public:
Teacher_Cadre(string na,int ag,char se,string add,string tel,string po,string ti):Teacher(na,ag,se,add,tel,ti),Cadre(na,ag,se,add,tel,po){}
void show()
{
Teacher::display();
cout<<Cadre::post<<endl;
cout<<wages<<endl;
}
};
int main()
{
Teacher_Cadre a("aaa",2,'x',"afs","vxzx","fxc","erw");
a.show();
}