- 博客(10)
- 收藏
- 关注
原创 第九周——时间类和输入输出运算符的重载
#includeusing namespace std;class CTime{private: int hour; // 时 int minute; // 分 int second; // 秒public: CTime(int h=0,int m=0,int s=0); void setTime(int h,int m,int s);
2014-04-28 09:39:30 635
原创 第九周——<<>>的重载(正常了)
#include using namespace std;class Complex{public: Complex(){real=0;imag=0;} friend ostream& operator<< (ostream& output, Complex& c); friend istream& operator>> (istream& i
2014-04-22 14:38:18 979
原创 第九章——<<>>的重载 (额这是怎么回事)
#include using namespace std;class Complex{public: Complex(){real=0;imag=0;} friend ostream& operator<< (ostream& output, Complex& c); friend istream& operator>> (istream& i
2014-04-22 13:24:38 899
原创 第八周————运算符重载(三)
#include using namespace std;#include using namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} friend Complex
2014-04-15 14:02:34 692
原创 第八周——用友元类完成重载
#include using namespace std;#include using namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} friend Complex
2014-04-15 09:17:28 938
原创 第八周——运算符的重载
#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 operato
2014-04-15 08:45:00 618
原创 第七周——友元函数求坐标距离
//例:使用成员函数、友元函数和一般函数的区别#include #include using namespace std;class CPoint{private: double x; // 横坐标 double y; // 纵坐标// 两点距离 public: CPoint(double xx=0,double yy=0):x(x
2014-04-10 14:28:02 702
原创 第七周——体验常成员函数
#includeusing namespace std;class A{private: int *arrayAddr;//保存一个有len个整型元素的数组的首地址 int len; //记录动态数组的长度 int max; //动态数组中的最大值(并非动态数组中必须要的数据成员)public: A(int *a,
2014-04-08 13:42:35 794
原创 坐标求三角形类
#include #include using namespace std;class CPoint{private: double x; // 横坐标 double y; // 纵坐标public: CPoint(double xx=0,double yy=0); double Distance1(CPoint p) const;
2014-04-01 15:12:08 764
原创 第六周——平面坐标点类
#include #include using namespace std;class CPoint{private: double x; // 横坐标 double y; // 纵坐标public: CPoint(double xx=0,double yy=0); double Distance1(CPoint p) const;
2014-04-01 12:55:08 745
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人