#include<iostream>
#include<string>
using namespace std;
class Person
{
public:
void Setall()
{
cin>>number>>name>>sex;
}
void Showall()
{
cout<<"编号为:"<<number<<" 姓名为:"<<name<<" 性别为:"<<sex;
}
protected:
int number;
string name;
string sex;
};
class Student: virtual public Person
{
public:
void Set()
{
cin>>classroom>>score;
}
void Show()
{
cout<<" 班级为:"<<classroom<<" 成绩为:"<<score<<endl;
}
private:
int classroom;
int score;
};
class Teacher: virtual public Person
{
public:
void Set1()
{
cin>>work>>subject;
}
void Show1()
{
cout<<" 职称为:"<<work<<" 所授课程名字为:"<<subject<<endl;
}
private:
string work;
string subject;
};
int main()
{
Student Stu;
Teacher Tea;
cout<<"学生信息:";
Stu.Showall();
Stu.Show();
cout<<"教师信息:";
Tea.Showall();
Tea.Show1();
return 0;
}