关于派生的问题
/********************************************************
** Highlight software by yzfy(雨中飞燕) http:// *
*********************************************************/
#include<iostream>
#include<cmath>
using namespace std;
class point
{
double X,Y;
public:
point(double,double);
};
class rectangle
{
public:
rectangle(double,double,double,double);
};
rectangle::rectangle(double a,double b,double c,double d)
{
double area;
area=abs(a-c)*abs(b-d);
cout<<"s="<<area<<endl;
}
point::point(double x,double y)
{X=x;Y=y;cout<<"x="<<X<<"y="<<Y<<endl;}
void main()
{
double a,b,c,d;
cin>>a>>b>>c>>d;
point A(a,b), B(c,d),C(a,d),D(c,b);
rectangle AREA(a,b,c,d);
}
** Highlight software by yzfy(雨中飞燕) http:// *
*********************************************************/
#include<iostream>
#include<cmath>
using namespace std;
class point
{
double X,Y;
public:
point(double,double);
};
class rectangle
{
public:
rectangle(double,double,double,double);
};
rectangle::rectangle(double a,double b,double c,double d)
{
double area;
area=abs(a-c)*abs(b-d);
cout<<"s="<<area<<endl;
}
point::point(double x,double y)
{X=x;Y=y;cout<<"x="<<X<<"y="<<Y<<endl;}
void main()
{
double a,b,c,d;
cin>>a>>b>>c>>d;
point A(a,b), B(c,d),C(a,d),D(c,b);
rectangle AREA(a,b,c,d);
}
如果point派生了retangle 要怎么改我改了几次 都发生了编译错误
[[it] 本帖最后由 走一圈 于 2008-6-1 19:37 编辑 [/it]]