> 其他 >
设计并测试一个名为Retangle的矩形类,其属性为矩形的左下角与右上角两个点的坐标,能计算矩形的面积
人气:395 ℃ 时间:2020-06-03 11:00:05
解答
#include
#include
class CPoint
{
public:
CPoint(float cx = 0,float cy = 0)
{
x = cx;
y = cy;
}
protected:
float x,y;
};
class CRect :public CPoint
{
public:
CRect(float left,float top,float right,float bottom):CPoint(left,top)
{
R = right;
B = bottom;
}
void Zlength()
{
cout
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版