- 博客(10)
- 收藏
- 关注
原创 项目一
#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-
2014-04-22 15:08:43 866
原创 分数类中的运算符重载
#include #include using namespace std; int gcd(int m,int n); class CFraction { private: int nume; // 分子 int deno; // 分母 public: CFraction(int nu=0,int de=1):nume(nu),deno(de)
2014-04-16 18:42:14 889
原创 Time类中的运算符重载
#include using namespace std; class CTime { private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒 public: CTime(int h=
2014-04-15 14:50:33 907
原创 实现复数类的运算重载
#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-
2014-04-15 14:30:58 741
原创 友元类
/* * 程序的版权和版本声明部分 * Copyright (c)2013, 烟台大学计算机学院学生 * All rightsreserved. * 文件名称: * 作 者: 王凯 * 完成日期: 2014年 4 月 8 日 * 版本号: v1.0 * 输入描述:无 * 问题描述: */ #include using namespace std; class D
2014-04-08 14:59:10 872
原创 体验成员函数
/* * 程序的版权和版本声明部分 * Copyright (c)2013, 烟台大学计算机学院学生 * All rightsreserved. * 文件名称: * 作 者: 王凯 * 完成日期: 2014年 4 月 8 日 * 版本号: v1.0 * 输入描述:无 * 问题描述: */ #include using namespace std; class A
2014-04-08 14:21:58 555
原创 深复制体验
#include #include using namespace std; class A { private: char *a; public: A(char *aa) { a = new char[strlen(aa)+1]; //(1)这样处理的意义在于:______________________________
2014-04-08 14:08:25 530
原创 静态成员应用
/* * 程序的版权和版本声明部分 * Copyright (c)2013, 烟台大学计算机学院学生 * All rightsreserved. * 文件名称: * 作 者: 王凯 * 完成日期: 2014年 4 月 7 日 * 版本号: v1.0 * 输入描述:无 * 问题描述: */ #include using namespace std; class Time{ public
2014-04-07 10:32:43 589
原创 体验常成员函数
/* * 程序的版权和版本声明部分 * Copyright (c)2013, 烟台大学计算机学院学生 * All rightsreserved. * 文件名称: * 作 者: 王凯 * 完成日期: 2014年 4 月 7 日 * 版本号: v1.0 * 输入描述:无 * 问题描述: */ #include #include using namespace std; class CPo
2014-04-07 10:30:36 737
原创 对象作为数据成员
#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-07 10:28:06 575
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人