1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#include <iostream>
class Point
{
protected:
int x, y;
public:
Point(int x, int y);
int Get_X(void) const;
int Get_Y(void) const;
void Print_LP(void);
};
class Point3D : public Point
{
protected:
int z;
public:
Point3D(int x, int y, int z);
int Get_Z(void) const;
void Print_LP(void);
};
void Point::Print_LP(void)
{
std::cout << x + 1 << ' ' << y + 1 << '\n';
}
void Point3D::Print_LP(void)
{
std::cout << x + 1 << ' ' << y + 1 << ' ' << z << '\n';
}
|