《c++程序设计》谭浩强_答案 第14章《c++程序设计》谭浩强_答案 第14章
14.1题
#include
#include
using namespace std;
double q(double,double,double); void main()
{double a,b,c,p,x1,x2;
cout>a>>b>>c;
p=-b/(2*a);
try
{x1=p+q(a,b,c);
x2=p-q(a,b,c);
cout
#include
using namespace std;
class Student...
《c++程序
设计
领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计
》谭浩强_答案 第14章
14.1
题
快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题
#include
#include
using namespace std;
double q(double,double,double); void main()
{double a,b,c,p,x1,x2;
cout<<"please enter a,b,c:";
cin>>a>>b>>c;
p=-b/(2*a);
try
{x1=p+q(a,b,c);
x2=p-q(a,b,c);
cout<<"x1="<
#include
using namespace std;
class Student
{public:
Student(int n,string nam)
{cout<<"constructor-"<
using namespace std;
#include "xt14-3-h1.h" #include "xt14-3-h2.h" using namespace std;
using namespace student1;
int main()
{Student stud1(1001,"Wang",18,"123 Beijing Road,Shanghua");
stud1.show_data();
student2::Student stud2(1102,"Li",'f',89.5);
stud2.show_data();
return 0;
}
14.3题H1
//header1.h
#include
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<<"num:"<
namespace student2
{class Student
{public:
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<<"num:"<
本文档为【《c++程序设计》谭浩强_答案 第14章】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。