#include <iostream>
using namespace std;
class Rectangle
{
public:
Rectangle(int left, int buttom, int right, int top);
int getArea();
private:
int m_left;
int m_buttom;
int m_right;
int m_top;
};
Rectangle :: Rectangle(int left, int buttom, int right, int top)
{
m_left = left;
m_buttom = buttom;
m_right = right;
m_top = top;
}
int Rectangle :: getArea()
{
int area;
area = (m_right - m_left) * (m_buttom - m_top);
return area;
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载