老是链接失败
现在编译没有错误老是链接有错误大家能不能详细解释一下
我是没有编程基础才学几天的新手
谢谢
//编写一个用于院校人事管理的程序,要求能够输入、显示各类人员的信息。
//假设院校有四类人员:学生,教师,员工和在职进修教师,他们都有姓名,性别、电话等共同信息
//学生具有年级、专业课程和各科成绩的信息,员工具有所在部门、工资的信息
//教师具有所在部门、工资和所授课程的信息,在职进修教师兼有教师和学生两类信息
#include<iostream>
#include<string>
using namespace std;
class College_person{
protected:
string name;
string sex;
int phone;
string duty;
public:
College_person(string tempduty="学生"):duty(tempduty)
{
cout<<duty<<endl;
cout<<"姓名:";
cin>>name;
cout<<"性别:";
cin>>sex;
cout<<"电话:";
cin>>phone;
}
void display()
{
cout<<"职务:"<<duty<<" 姓名:"<<name<<" 性别:"<<sex<<" 电话:"<<phone<<endl;
}
};
class Student:public College_person{
protected:
int grade;
string study_class[3];
int score[3];
int i;
public:
Student():College_person("学生")
{
cout<<"年级:";
cin>>grade;
cout<<"专业课程:";
for(i=0;i<3;i++)
cin>>study_class[i];
cout<<"各科成绩:";
for(i=0;i<3;i++)
cin>>score[i];
}
void show()
{
College_person::display();
cout<<"年级:"<<grade<<" 专业课程:";
for(i=0;i<3;i++)
cout<<study_class[i]<<" ";
cout<<" 各科成绩: ";
for(i=0;i<3;i++)
cout<<score[i]<<" ";
cout<<endl;
}
};
class Workers:virtual public College_person{
protected:
string department;
float salary;
public:
Workers():College_person("员工")
{
cout<<"部门:";
cin>>department;
cout<<"工资:";
cin>>salary;
}
void show()
{
College_person::display();
cout<<"部门:"<<department<<" 工资:"<<salary;
cout<<endl;
}
};
class Teachers:public Workers{
protected:
int i;
string teach_class[3];
public:
Teachers():Workers(),College_person("教师")
{
cout<<"所授课程:";
for(i=0;i<3;i++)
cin>>teach_class[i];
}
void show()
{
Workers::show();
cout<<" 所授课程:";
for(i=0;i<3;i++)
cout<<teach_class[i]<<" ";
cout<<endl;
}
};
class Advanced_teacher:public Student,public Teachers{
public:
int i;
Advanced_teacher():Student(),Teachers(),College_person("在职进修教师")
{}
void show()
{
Student::show();
Teachers::show();
}
};
void main()
{
Student a;
a.show();
Workers b;
b.show();
Teachers c;
c.show();
Advanced_teacher d;
d.show();
}