
学习任务
文章平均质量分 71
菜鸟零零七
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
定义一个复数类complex重载运算符+ - * /使之能用于复数的加减乘除。
#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); Complex operator-(Complex &c2); Comple翻译 2013-05-15 17:18:32 · 9679 阅读 · 2 评论 -
dgsd
#include class Matrix {public: Matrix(); friend Matrix operator+(Matrix &,Matrix &); void input(); void display(); private: int mat[2][3]; }; Matrix::Matrix() {for(int i=0;i for(int j=0;j翻译 2013-05-22 17:24:24 · 967 阅读 · 0 评论 -
编写一个程序定义抽象类有他派生五个派生类 圆 正方形 矩形 梯形 三角形用函数分别求面积 总面积 要求用基类指针数组
#include using namespace std; class Shape {public: virtual double area()const=0; }; class Circle:public Shape {public: Circle(double r):radius(r){} virtual double area() const{return 3.14159*翻译 2013-06-12 17:00:29 · 3803 阅读 · 0 评论