第五章9

#include 
#include  
using namespace std; 
class Teacher 
 {public: 
   Teacher(string nam,int a,char s,string tit,string 
ad,string t); 
   void display(); 
  protected: 
    string name; 
    int age; 
    char sex; 
    string title; 
    string addr; 
    string tel; 
};  
Teacher::Teacher(string nam,int a,char s,string tit,string 
ad,string t): 
     name(nam),age(a),sex(s),title(tit),addr(ad),tel(t){ } 
void Teacher::display() 
     {cout<<"name:"<
第五章9_第1张图片

你可能感兴趣的:(第五章派生)