有没有人帮我看看
#include<iostream>using namespace std;
#include<string>
class Teacher
{
public:
Teacher(string nam,int a,string s,string ad,string tele,string t)
{
name=nam;
age=a;
sex=s;
address=ad;
telephone=tele;
title=t;
}
void display();
protected:
string name;
int age;
string sex;
string address;
string telephone;
string title;
};
void Teacher::display()
{
cout<<"姓名:"<<Teacher::name<<endl;
cout<<"年龄:"<<Teacher::age<<endl;
cout<<"性别:"<<Teacher::sex<<endl;
cout<<"地址:"<<Teacher::address<<endl;
cout<<"电话:"<<Teacher::telephone<<endl;
cout<<"职称:"<<Teacher::title<<endl;
}
class Cadre
{
public:
Cadre(string nam,int a,string s,string ad,string tele,string p):name(nam),age(a),sex(s),address(ad),telephone(tele),post(p){}
void show_cadre();
protected:
string name;
int age;
string sex;
string address;
string telephone;
string post;
};
void Cadre::show_cadre()
{
cout<<"姓名:"<<Cadre::name<<endl;
cout<<"年龄:"<<Cadre::age<<endl;
cout<<"性别:"<<Cadre::sex<<endl;
cout<<"地址:"<<Cadre::address<<endl;
cout<<"电话:"<<Cadre::telephone<<endl;
cout<<"职务:"<<Cadre::post<<endl;
}
class Teacher_Cadre:public Teacher,public Cadre
{
public:
Teacher_Cadre(string nam,int a,string s,string ad,string tele,string t,string p,int w):Teacher(nam,a,s,ad,tele,t),Cadre(nam,a,s,ad,tele,p),wage(w){}
void show();
protected:
int wage;
};
void Teacher_Cadre::show()
{
Teacher::display();
cout<<"职务:"<<Cadre::post<<endl;
cout<<"工资:"<<Teacher_Cadre::wage<<endl;
}
void main()
{
Teacher_Cadre tc("分复苏",59,"男","额度分公司的","39503865","丰富","非法第三方",50000000);
cout<<"老师_干部类:"<<endl;
tc.show();
}
把 #include<iostream>
using namespace std;换成#include<iostream.h>就出错 在vc++6.0编的