自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

赖卓成的博客

赖卓成的程序人生博客

  • 博客(7)
  • 收藏
  • 关注

原创 单目运算符重载为友元函数

#include<iostream>using namespace std;class point{private:    int x,y;public:    point(int xx=0,int yy=0)    {x=xx;y=yy;}   void display(){cout<<"x="<<x<<",y="<&a

2018-07-23 15:39:22 1865 1

原创 单目运算符重载为成员函数

#include<iostream>using namespace std;class point{private:    int x,y;public:    point(int xx=0,int yy=0)    {x=xx;y=yy;}    point operator ++(int)//后置++加上一个int  前置不用加    {        x+...

2018-07-23 15:08:36 763

原创 this 指向当前对象,通过它可以访问当前对象的所有成员。

#include<iostream>using namespace std;class eg{private:    int a;public:    eg(int b)    {a=b;}    void add (int m)    {            eg p(5);        p.a=p.a+m;        *this=p;//this指...

2018-07-23 14:47:51 1771

原创 运算符重载实现复数的相加减

#include<iostream>using namespace std;class complex{private:    double real;    double imag;public:    complex(double r=0,double i=0):real(r),imag(i){}    complex operator + (complex &a...

2018-07-23 00:43:37 3000

原创 类的组合:computer

#include<iostream>using namespace std;enum RAM_Type {DDR2=2, DDR3, DDR4};enum CPU_Rank {P1,P2,P3,P4,P5,P6};enum ROM_Type{SATA,USB};enum ROM_Installation{external,builtin};class RAM{priva...

2018-07-20 15:01:45 854

原创 枚举类

//不同枚举类中枚举常量值有相同的名字不会发生冲突,普通枚举类型会冲突#include<iostream>using namespace std;enum class Side(Right,Left);enum class Thing(Wrong,Right);int main(){    Side s=Side::Right;    Thing w=Thing::R...

2018-07-20 01:30:00 82

原创 类的组合 计算线段长度

#include<iostream>#include<math.h>using namespace std;class Point{private:    int x,y;public:    Point(int xx,int yy)    {x=xx;y=yy;}    int getx()    {return x;}    int gety()...

2018-07-19 18:12:50 1761

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除