设计并测试一个名为Retangle的矩形类,其属性为矩形的左下角与右上角两个点的坐标,能计算矩形的面积

gudujianke0917 1年前 已收到1个回答 举报

philiplyf 春芽

共回答了20个问题采纳率:95% 举报

#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

1年前

2
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.009 s. - webmaster@yulucn.com