全文预览

《c++程序设计》谭浩强课后习题答案

上传者:叶子黄了 |  格式:pdf  |  页数:102 |  大小:10405KB

文档介绍
on Warning : The document was created with Spire.PDF for .NET.\r14.3 # Hl\r//header! .h\r#include <string>\rnamespace student 1\r{class Student\r{public:\rStudent(int n,string nam,int a,string addr)\r{num=n;name=nam;age=a;address=addr;}\rvoid show_data();\rprivate:\rint num;\rstring name;\rint age;\rstring address;\r}.\rvoid Student: :show_data()\r{coutHnum: n n um** name: ,*nam eH age: H ag e\r n address:Haddressendl;\r14.3 # H2\r//header2.h\r#include <string>\rnamespace student2\r{class Student\r{public:\rStudent(int n,string nam,char s,float sco)\r{num=n;name=nam;sex=s;score=sco;}\rvoid show_data();\rprivate:\rint num;\rstring name;\rchar sex;\rfloat score;\r);\rvoid Student: :show_data()\r{cout"num:,, n u m  M nam e:"nam eH sex:nsex\r** score:nscoreendl;}

收藏

分享

举报
下载此文档