c++,类的多重继承的困惑

计算三角形面积
由抽象类Point表示一个点并由其在空间上的坐标(x,y)确定,有纯virtual函数display(),该函数用于在派生类中显示面积;Point派生出类Line,该类是由两点构成的一线段;Line类派生出类Triangle是三角形面,该类由一线段和一点构成,该类有数据成员area(面积)。
请定义这三个类,并按以下要求编写应用程序:
有三个面对象a(0,0,3,5,9,8)、b(2,4,6,7,5,8)、c(1,2,3,6,9,9)和一个double变量sum表示a、b、c的面积和(即有语句:sum=a+b+c)并分别显示a、b、c的面积和sum。

海伦公式:
已知三角形三边x、y、z,设 p=(x+y+z)/2,则面积S=sqrt(p*(p-x)*(p-y)*(p-z)),函数sqrt()在中。 输入的类型为a(0,1,5,7,6,8)这种
#include
#include
#include
using namespace std;
class Point
{
public:
Point();
Point(double xx,double yy)
{
X=xx;Y=yy;
}
Point(Point&p);
double GetX()
{
return X;
}
double GetY()
{
return Y;
}
private:
double X,Y;
};
Point::Point(Point&p)
{
X=p.X;
Y=p.Y;
}
class Line:public Point
{
public:
Line();
Line(Point xp1,Point xp2);
Line(Line&L);
double GetLength()
{
return length;
}
private:
Point p1,p2;
double length;
};
Line::Line(Point xp1,Point xp2):p1(xp1),p2(xp2)
{
double x=p1.GetX()-p2.GetX();
double y=p1.GetY()-p2.GetY();
length=sqrt(x*x+y*y);
}
Line::Line(Line&L):p1(L.p1),p2(L.p2)
{
length=L.length;
}
class Triangle:public Line
{
public:
Triangle(Line ap1,Line ap2,Line ap3);
Triangle(Triangle&T);
double GetArea()
{
return area;
}
private:
Line l1,l2,l3;
double area;
};
Triangle::Triangle(Line ap1,Line ap2,Line ap3):l1(ap1),l2(ap2),l3(ap3)
{
double p=(l1.GetLength()+l2.GetLength()+l3.GetLength())/2.0;
area=sqrt(p*(p-l1.GetLength())*(p-l2.GetLength())*(p-l3.GetLength()));
}
Triangle::Triangle(Triangle&T):l1(T.l1),l2(T.l2),l3(T.l3)
{
area=T.area;
}
int main()
{
double x1,y1,x2,y2,x3,y3;
double sum=0.0,s=0.0;;
char a='a';
for(int i=0;i {
cout cin>>x1>>y1>>x2>>y2>>x3>>y3;
cout<<"已获取坐标"<<endl;
Point p1(x1,y1),p2(x2,y2),p3(x3,y3);
Line line1(p1,p2),line2(p2,p3),line3(p3,p1);
Triangle t(line1,line2,line3);
cout<<a<<"面的面积为"<<t.GetArea()<<endl;
a++;
s=t.GetArea();
sum=sum+s;
if(i==2)
cout<<"a、b、c的面积和为"<<sum<<endl;;
}
}

纯virtual函数display,没看到,在哪里?

不会定义,参考这里 http://www.docin.com/p-964171185-f2.html
http://blog.csdn.net/g975291783/article/details/39210575

报错了,能不能修正一下