namespace student1 {class Student {public:
Student(int n,string nam,int a,string addr) {num=n;name=nam;age=a;address=addr;} void show_data(); private: int num; string name; int age; string address; };
void Student::show_data()
{cout<<\ <<\ } }
//,文件名为 #include
Student(int n,string nam,char s,float sco) {num=n;name=nam;sex=s;score=sco;} void show_data(); private:
int num; string name; char sex; float score; };
void Student::show_data()
{cout<<\ <<\ }
c++面向对象程序设计课后习题答案(谭浩强版)
namespacestudent1{classStudent{public:Student(intn,stringnam,inta,stringaddr){num=n;name=nam;age=a;address=addr;}voidshow_data();private:int
推荐度:
点击下载文档文档为doc格式