#include
class point
{
public:
point(float a,float b)
{
x=a;
y=b;
cout<<"x="< cout<<"y="< }
float getx()
{
return x;
}
float gety()
{
return y;
}
private:
float x,y;
};
class circle:public point
{
private:
float r;
public:
circle(float a,float b,float c):point(a,b)
{
r=c;
cout<<"r="< }
float area()
{
return 2*r*r*3.14;
};
class cylinder:public circle
{
private:
float h;
public:
cylinder(float a,float b,float c,float d):circle(float a,float b,float c)
{
h=d;
cout<<"h="< }
float biao()
{
float m,n;
m=2*3.14*r;
n=m*h+2*circle::area();
return n;
}
float tiji()
{
return circle::area()*h;
};
void main()
{
float s;
cylinder c1;
s=c1.tiji();
cout<
}
结果编译显示 'circle' : base class undefined
fatal error C1004: unexpected end of file found
--------------------next---------------------
阅读(1058) | 评论(0) | 转发(0) |