#include<iostream.h>
class point
{
protected:
double x,y;
public:
point(){x=0;y=0;}
point(double x1,double y1){x=x1;y=y1;}
void show()
{cout<<"点("<<x<<","<<y<<"
"<<endl;}
};
class zheng:public point
{
protected:
double length,area;
public:
zheng(double x1,double y1,double l):point(x1,y1)
{length=l;}
void show()
{
point::show();
cout<<"area="<<length*length<<endl;;
}
};
class cubic:public zheng
{
protected:double V;
public:
cubic(double x2,double y2,double l):zheng(x2,y2,l)
{};
void show()
{
point::show();
cout<<"V="<<length*length*length<<endl;
}
};
void main()
{
zheng A(1,2,3);
cubic B(2,3,3);
A.show();
B.show();
}