#include<iostream>
#include<string>
using namespace std;
class base{
public:
base()
{
name="liming";
age="45";
cout<<"name:"<<name<<" "<<"age:"<<" "<<age<<endl;
cout<<endl;
cout<<"*********************************************"<<endl;
cout<<endl;
}
protected:
stringname;
stringage;
};
class leader:virtual public base{
public:
leader()
{
job="主任";
de="科研处";
cout<<"name:"<<name<<" "<<"age:"<<age<<" ";
cout<<"job:"<<job<<" "<<"departure:"<<de<<endl;
cout<<endl;
cout<<"*********************************************"<<endl;
cout<<endl;
}
protected:
stringjob;
stringde;
};
class engineer:virtual public base{
public:
engineer()
{
pro="工程师";
major="电工";
cout<<"name:"<<name<<" "<<"age:"<<age<<" ";
cout<<"professional:"<<pro<<" "<<"major:"<<major<<endl;
cout<<endl;
cout<<"*********************************************"<<endl;
cout<<endl;
}
protected:
stringpro;
stringmajor;
};
class chairman:public leader,publicengineer{
public:
chairman()
{
cout<<"name:"<<name<<" "<<"age:"<<age<<" ";
cout<<"job:"<<job<<" "<<"departure:"<<de<<" ";
cout<<"professional:"<<pro<<" "<<"major:"<<major<<endl;
cout<<endl;
cout<<"*********************************************"<<endl;
}
};
int main()
{
chairmanobj;
return0;
}