- 博客(16)
- 收藏
- 关注
原创 课堂感悟
经过了半个学期的c++课程的学习,我不仅仅学习到了知识,我也有了一些感悟。我明白了学习就像一望无际的海洋,无比的宽阔,学生就像海上的小船,在这迷茫的大海上寻找着海岸。 学习有困难,但我们不能怕困难,成功是需要努力的
2016-06-23 19:05:40 2153
原创 数组类运算的实现
#include #include #include using namespace std; class Array { private: int *list; int size; public: Array(int sz=50); Array(int a[],int sz);//构造函数 Array(const Array
2016-06-15 19:35:08 496
原创 实现复数类中的运算符重载2
#include using namespace std; class Complex { public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} friend Complex operator+(Complex &c1,Complex &c2); f
2016-06-15 19:33:11 502
原创 实现复数类中的运算符重载
#include using namespace std; class Complex { public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(const Complex &c2); Complex operat
2016-06-15 19:31:00 658
原创 Time类中的运算符重载
#include using namespace std; class CTime { private: unsigned short int hour; unsigned short int minute; unsigned short int second; public: CTime(int h=0,int m=0,int s=0);
2016-06-15 19:28:05 263
原创 形状类族的中的纯虚函数
#include using namespace std; class Shape { public: virtual double area()=0; }; class Circle:public Shape { public: Circle(double r) { radius=r; } double are
2016-06-15 19:23:14 256
原创 立体类族共有的抽象类
#include using namespace std; class CSolid { public: virtual void area()=0; virtual void volume()=0; }; class CCube:public CSolid { public: CCube(double e):edge(e){} void
2016-06-15 19:21:56 181
原创 分数类的运算符重载
#include using namespace std; class CFraction { private: int nume; int deno; public: CFraction operator+(const CFraction &c2); CFraction operator-(const CFraction &c2);
2016-06-15 19:19:28 261
原创 动物叫
#include #include using namespace std; class Animal { public: virtual void cry() { cout } }; class Mouse:public Animal { public: Mouse(string n,char s) {
2016-06-15 19:16:47 219
原创 深复制2
#include #include using namespace std; class A { private: char *a; public: A(char *aa) { a=new char[strlen(aa)+1];//深复制的精髓 strcpy(a,aa); } A(A &obj)
2016-06-08 20:24:48 152
原创 深复制1
#include #include using namespace std; class A { private: char *a; public: A(char *aa) { a=new char[strlen(aa)+1]; strcpy(a,aa); } ~A() {
2016-06-08 20:24:13 148
原创 数组类
#include using namespace std; class MyArray { private: int *arrayAddr; int len; int max; public: MyArray(int *a,int n); ~MyArray(); int getValue(int i); int ge
2016-06-08 20:23:13 217
原创 圆柱类
#include using namespace std; class Point { public: Point(double xx,double yy) { x=xx; y=yy; } void Show_point() { cout } private: d
2016-06-08 20:22:12 246
原创 教师兼干部类
#include using namespace std; class Teacher { public: Teacher(string n1,int a,string s,string add,string tel,string ti) { name=n1; age=a; sex=s; addr
2016-06-08 20:20:35 167
原创 警察与厨师
#include using namespace std; class Person { public: Person(int a,string n) { age=a; name=n; } void action() { cout } int getAge()
2016-06-08 20:17:57 371
原创 储存班长信息的学生类
#include using namespace std; class Stu { public: Stu(int n,string nam) { num=n; name=nam; } void display() { cout cout } protec
2016-06-08 20:15:26 189
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人