#include<iostream>
#include<string>
using namespace std;
class Person{
public:
Person(string name1,int age1){
name=name1;
age=age1;}
void print()
{cout<<"姓名"<<name<<endl;
cout<<"年龄"<<age<<endl;
}
protected:
string name;
int age;
};
class Leader:virtual public Person{
public:
Leader(string name1,int age1,string post1,string dept1)
Person(name1,age1)
{post=post1;
dept=dept1;}
void print()
{Person::print();
cout<<"职务:"<<post<<endl;
cout<<"部门:"<<dept<<endl;
}
protected:
string
#include<string>
using namespace std;
class Person{
public:
Person(string name1,int age1){
name=name1;
age=age1;}
void print()
{cout<<"姓名"<<name<<endl;
cout<<"年龄"<<age<<endl;
}
protected:
string name;
int age;
};
class Leader:virtual public Person{
public:
Leader(string name1,int age1,string post1,string dept1)
Person(name1,age1)
{post=post1;
dept=dept1;}
void print()
{Person::print();
cout<<"职务:"<<post<<endl;
cout<<"部门:"<<dept<<endl;
}
protected:
string