c++
文章平均质量分 83
ye_nianfeng
这个作者很懒,什么都没留下…
展开
-
35页作业
c++作业35页原创 2015-03-28 14:23:37 · 395 阅读 · 0 评论 -
c++第三章作业
C ++ 第三章作业 1、答案: 构造函数的作用:用于新建对象的初始化工作。 析构函数的作用:用于在撤销对象前,完成一些清理工作,比如:释放内存等。 每当创建对象时,需要添加初始化代码时,则需要定义自己的构造函数; 而对象撤销时,需要自己添加清理工作的代码时,则需要定义自己的析构函数。 2.略。 3.#include //第三小题 using namespace原创 2015-04-20 15:23:43 · 668 阅读 · 0 评论 -
C++重载运算符
C++重载运算符原创 2015-04-27 22:01:33 · 348 阅读 · 0 评论 -
课上作业:创建一个三角形类
修改后的 程序如下: //扩展程序:创建一个三角形类 //修改create_object函数,使得程序支持三角形的创建 //和求面积、打印等操作 #include using namespace std; class Shape { public: virtual double getArea() const =0; virtual void print() c原创 2015-05-26 19:06:21 · 572 阅读 · 0 评论 -
第五章 作业
第五章 作业 1、 #include using namespace std; class Student{ public: void get_value() {cin>>num>>name>>sex;} void display() { cout cout cout } private: int num; cha原创 2015-06-16 18:59:52 · 357 阅读 · 0 评论 -
c++第四章
c++第四章 //第一小题 #include using namespace std; class Complex{ public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator + (Complex &c2); void display原创 2015-05-04 22:38:25 · 362 阅读 · 0 评论 -
第六章 作业
第六章 作业 1. #include class Point {public: Point(float x=0,float y=0); void setPoint(float,float); float getX() const {return x;} float getY() const {return y;} friend ostream & operator pro原创 2015-06-23 17:27:53 · 422 阅读 · 0 评论 -
第八章 作业
第八章 作业 1.#include #include using namespace std; double s(double,double,double); void main() { double a,b,c,d,x1,x2; cout cin>>a>>b>>c; d=-b/(2*a); x1=d+s(a,b,c); x2=d-s(a,b,c);原创 2015-06-23 17:11:08 · 358 阅读 · 0 评论 -
第 七章 作业
第六章 作业 1、原创 2015-06-16 20:13:15 · 317 阅读 · 0 评论