?? rectangle.h
字號:
class Point
{
public:
Point(float xx=0,float yy=0)
{x=xx;y=yy;}
Point(Point &p){x=p.x;y=p.y;}
~Point(){};
float Getx(){return x;}
float Gety(){return y;}
void SetP(float xx=0,float yy=0){x=xx;y=yy;}
void Move(float xoff,float yoff){x+=xoff;y+=yoff;}
private:
float x,y;};
class Rectangle:public Point
{
public:
void Set(float xx,float yy,float w,float h)
{
SetP(xx,yy); W=w; H=h;
}
float GetH(){return H;}
float GetW(){return W;}
float Area()
{return W*H;}
float Cum()
{return 2*(W+H);}
private:
float W,H;};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -