#include<iostream>
using namespace std;
class Point
{
private:
double x;
double y;
public:
Point(double xx=0,double yy=0):x(xx),y(yy){}
void setPoint(double xx,double yy)
{
x=xx;
y=yy;
}
double getx()
{
return x;
}
double gety()
{
return y;
}
void shuchu()
{
cout<<x<<" "<<y<<endl;
}
};
class Circle:public Point
{
private:
double r;
public:
Circle(double xx=0,double yy=0,double zz=0)
{
Point(xx,yy);
r=zz;
}
void set(double rr)
{
r=rr;
}
double fanhui()
{
return r;
}
void area()
{
cout<<3.14*r*r<<endl;
}
};
class Cylinder:public Circle
{
private:
double h;
public:
Cylinder(double xx=0,double yy=0,double zz=0,double kk=0)
{
Circle(xx,yy,zz);
h=zz;
}
void area()
{
cout<<3.14*fanhui()*fanhui()*h<<endl;
}
};
int main()
{
Cylinder a(1,2,3,4);
a.area;
}
using namespace std;
class Point
{
private:
double x;
double y;
public:
Point(double xx=0,double yy=0):x(xx),y(yy){}
void setPoint(double xx,double yy)
{
x=xx;
y=yy;
}
double getx()
{
return x;
}
double gety()
{
return y;
}
void shuchu()
{
cout<<x<<" "<<y<<endl;
}
};
class Circle:public Point
{
private:
double r;
public:
Circle(double xx=0,double yy=0,double zz=0)
{
Point(xx,yy);
r=zz;
}
void set(double rr)
{
r=rr;
}
double fanhui()
{
return r;
}
void area()
{
cout<<3.14*r*r<<endl;
}
};
class Cylinder:public Circle
{
private:
double h;
public:
Cylinder(double xx=0,double yy=0,double zz=0,double kk=0)
{
Circle(xx,yy,zz);
h=zz;
}
void area()
{
cout<<3.14*fanhui()*fanhui()*h<<endl;
}
};
int main()
{
Cylinder a(1,2,3,4);
a.area;
}