#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
class Teacher{
public:
Teacher(string ="",string ="");
~Teacher(){}
void Show_Teacher();
private:
string num;
string name;
} ;
Teacher::Teacher(string n1,string n2):num(n1),name(n2){}
void Teacher::Show_Teacher(){
cout<<setw(8)<<"num"<<setw(8)<<"name"<<endl;
cout<<setw(8)<<num<<setw(8)<<name<<endl;
}
int main(){
Teacher t("t001","杨桃");
t.Show_Teacher();
return 0;
}
定义教师类Teacher,并在主函数中定义对象进行测试(第五天…