一道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/20 07:22:11
一道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();