📄 rectangle.h
字号:
#include <iostream>
using namespace std;
class Rectangle : public Shape
{
public:
Rectangle(double _width, double _height);
double area();
double girth();
void show();
private:
Rectangle();
double width;
double height;
};
Rectangle::Rectangle(double _width, double _height)
{
width = _width;
height = _height;
}
double Rectangle::area()
{
return width * height;
}
double Rectangle::girth()
{
return (width + height) * 2;
}
void Rectangle::show()
{
Shape::show();
cout<<"Type: Rectangle"<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -