题 号: 150 继承Point类(C++) 语言要求: C++
引入CPoint.h
头文件,它的内容如下:
#include <iostream>
using namespace std;
class Point{
public:
Point(float xx, float yy){
x = xx;
y =yy;
}
private:
float x;
float y;
};
class Rectangle :public Point{
public:
Rectangle(float xx,float yy,float w,