有错误,但是不会改,求帮助
#include <iostream>using namespace std;
class Teacher
{
char name;
int age;
char sec;
char address;
int phone;
char title;
public:
void getna();
void getag();
void getse();
void getad();
void getph();
void getti();
void display();
};
class Cadre
{
char name;
int age;
char sec;
char address;
int phone;
char post;
public:
void getna();
void getag();
void getse();
void getad();
void getph();
void getpo();
void display_1();
};
class Teacher_Cadre:public Teacher,protected Cadre
{
int wages;
public :
void getwa();
void show();
};
void Teacher::getna()
{
cout <<"putin the teacher's name:";
cin>>name;
};
void Teacher::getag()
{
cout <<"putin the teacher's age:";
cin>>age;
};
void Teacher::getse()
{
cout <<"putin the teacher's sec:";
cin>>sec;
};
void Teacher::getad()
{
cout <<"putin the teacher's address:";
cin>>address;
};
void Teacher::getph()
{
cout <<"putin the teacher's phone:";
cin>>phone;
};
void Teacher::getti()
{
cout <<"putin the teacher's title:";
cin>>title;
};
void Teacher::display()
{
cout<<"name:"<<name<<"age:"<<age<<"sec:"<<sec<<"title:"<<title<<"address:"<<address<<"phone:"<<phone;
};
void Cadre::getna()
{
cout <<"putin the teacher's name:";
cin>>name;
};
void Cadre::getag()
{
cout <<"putin the teacher's age:";
cin>>age;
};
void Cadre::getse()
{
cout <<"putin the teacher's sec:";
cin>>sec;
};
void Cadre::getad()
{
cout <<"putin the teacher's address:";
cin>>address;
};
void Cadre::getph()
{
cout <<"putin the teacher's phone:";
cin>>phone;
};
void Cadre::getpo()
{
cout <<"putin the teacher's post:";
cin>>post;
};
void Cadre::display_1()
{
cout<<"post:"<<post;
};
void Teacher_Cadre::getwa()
{
cout <<"putin the Teacher_Cadre'wages:";
cin>>wages;
};
void Teacher_Cadre::show()
{
display();
display_1();
cout<<"wages:"<<wages;
};
int main()
{
Teacher_Cadre a;
a.Teacher::getna;
a.Teacher::getag;
a.Teacher::getse;
a.Teacher::getad;
a.Teacher::getph;
a.getpo;
a.getti;
a.getwa;
a.show;
return 0;
}