一道C++作业,求帮我看看自己写的哪里错了#include#includeclass Teacher{public:Teacher(string n,int a,string s,string add,string t,string tit){name=n;age=a;sex=s;address=add;tel=t;title=tit;}void display();protected:string name;int age;s

来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 17:34:16
一道C++作业,求帮我看看自己写的哪里错了#include#includeclass Teacher{public:Teacher(string n,int a,string s,string add,string t,string tit){name=n;age=a;sex=s;address=add;tel=t;title=tit;}void display();protected:string name;int age;s
xkKPǿJ*&&6 #콜M6rҹMT&C8]7$;=mjr{9<9IٝZ Xp}΢{nNfz>\Ox Zg٨Z$QP*< ěsjR/LQ߳`K @4D}as6A@AuVJ 6>*`>ı-VԨzOOp)1ӹ iz`$Hx\G.&.`<ѥ֕}tL栊UL^+8eVȝ / C) fpN"}$2H̠hZ$f1:ڈwR5XnmwíˁM~ 6 ANJq\l4ѫʇ  a2%(eIl\5_Ls N[f hcA /.;dlD:#oF

一道C++作业,求帮我看看自己写的哪里错了#include#includeclass Teacher{public:Teacher(string n,int a,string s,string add,string t,string tit){name=n;age=a;sex=s;address=add;tel=t;title=tit;}void display();protected:string name;int age;s
一道C++作业,求帮我看看自己写的哪里错了
#include
#include
class Teacher
{public:
Teacher(string n,int a,string s,string add,string t,string tit)
{
name=n;
age=a;
sex=s;
address=add;
tel=t;
title=tit;
}
void display();
protected:
string name;
int age;
string sex;
string address;
string tel;
string title;
};
void Teacher::display()
{
cout

一道C++作业,求帮我看看自己写的哪里错了#include#includeclass Teacher{public:Teacher(string n,int a,string s,string add,string t,string tit){name=n;age=a;sex=s;address=add;tel=t;title=tit;}void display();protected:string name;int age;s



int main()中的代码有问题,第一是双引号问题,第二是参数之间的逗号,注意使用英文输入下的逗号
Teacher_Cadre A("陈毅",20,"男","江阴","123456","没有","看厕所",500);
A.show();