怎么运行出错
#include <iostream>#include<string>
using namespace std;
class people
{ public:
char name[20];
int num;
int sex;
int num1;
people()
{num=0;
sex=0;
num1=0;
strcpy(name,"no name");
}
void set()
{cout<<"姓名"<<endl;
cin>>name;
cout<<"编号"<<endl;
cin>>num;
cout<<"性别"<<endl;
cin>>sex;
cout<<"身份证号"<<endl;
cin>>num1;
}
void show()
{cout<<"姓名"<<name<<endl;
cout<<"编号"<<num<<endl;
cout<<"性别"<<sex<<endl;
cout<<"身份证号"<<num1<<endl;
}
};
class student:virtual public people
{
public:
int sumtime4;
int weektime;
student():people()
{sumtime4=0;
weektime=0;}
void set()
{people::set();
cout<<"总学时数"<<endl;
cin>>sumtime4;
cout<<"周学时数"<<endl;
cin>>weektime;}
void show()
{cout<<"姓名"<<name<<endl;
cout<<"编号"<<num<<endl;
cout<<"性别"<<sex<<endl;
cout<<"身份证号"<<num1<<endl;
cout<<"总学时数"<<sumtime4<<endl;
cout<<"周学时数"<<weektime<<endl;}
};
class teacher:virtual public people
{public:
int teachtime;
int sumteach4;
teach():people()
{teachtime=0;
sumteach4=0;}
void set()
{people::set;
cout<<"总学时数"<<<<endl;
cin>>sumteach4;
cout<<"周学时数"<<<<endl;
cin>>teachtime;}
void show()
{cout<<"姓名"<<name<<endl;
cout<<"编号"<<num<<endl;
cout<<"性别"<<sex<<endl;
cout<<"身份证号"<<num1<<endl;
cout<<"总学时数"<<teachtime<<endl;
cout<<"周学时数"<<sumteach4<<endl;}
};
class graduate: virtual public student
{public:
int yantime;
int sumtime;
graduate():student()
{
yantime=0;
sumtime=0;
}
void set()
{student::set();
cout<<"周研究时间"<<endl;
cin>>yantime;
cout<<"总研究时间"<<endl;
cin>>sumtime;}
void show()
{cout<<"姓名"<<name<<endl;
cout<<"编号"<<num<<endl;
cout<<"性别"<<sex<<endl;
cout<<"身份证号"<<num1<<endl;
cout<<"总学时数"<<sumtime<<endl;
cout<<"周学时数"<<weektime<<endl;
cout<<"周研究时间"<<yantime<<endl;
cout<<"总研究时间"<<sumtime<<endl;
};
//添加程序
class TA:public student,public teacher
{public:
int yantime;
int sumtime2;
TA():student():teacher()
{yantime=0;
sumtime=0;}
void set()
{cout<<"姓名"<<endl;
cin>>name;
cout<<"编号"<<endl;
cin>>num;
cout<<"性别"<<endl;
cin>>sex;
cout<<"身份证号"<<endl;
cin>>num1;
cout<<"总学时数"<<endl;
cin>>sumtime4;
cout<<"周学时数"<<endl;
xin>>weektime;
cout<<"周研究时间"<<endl;
cin>>yantime;
cout<<"总研究时间"<<endl;
cin>>sumtime2;
cout<<"周教学时间"<<endl
cin>>teachtime;
cout<<"总教学时间"<<endl;
cin>>sumtime;}
void show()
{cout<<"姓名"<<name<<endl;
cout<<"编号"<<num<<endl;
cout<<"性别"<<sex<<endl;
cout<<"身份证号"<<num1<<endl;
cout<<"总学时数"<<sumtime<<endl;
cout<<"周学时数"<<weektime<<endl;
cout<<"周研究时间"<<yantime<<endl;
cout<<"总研究时间"<<sumtime<<endl;
cout<<"周教学时间"<<teachtime<<endl;
cout<<"总教学时间"<<sumteach4<<endl;};
};
void main()
{teacher fgh();
fgh.set();
fgh.show;
}