### 题目描述

#include <iostream.h>
#define PI 3.14159
class Point
{
public:
Point(float=0,float=0);
void setPoint(float,float);
float getX()const ;
float getY()const ;
friend ostream & operator<<(ostream &,const Point &);
protected:
float x,y;
};
class Circle:public Point
{
public:
Circle(float x=0,float y=0,float r=0);
float area () const;
friend ostream &operator<<(ostream &,const Circle &);
protected:
};
class Cylinder:public Circle
{
public:
Cylinder (float x=0,float y=0,float r=0,float h=0);
void setHeight(float);
float getHeight() const;
float area() const;
float volume() const;
friend ostream& operator<<(ostream&,const Cylinder&);
protected:
float height;
};
//小聪用于测试的函数
int main()
{
Cylinder cy1(3.5,6.4,5.2,10);
cy1.setHeight(15);
cy1.setPoint(5,5);
cout<<"new cylinder:
"<<cy1;
Point &pRef=cy1;
cout<<"pRef as a point:"<<pRef;
Circle &cRef=cy1;
cout<<"cRef as a Circle:"<<cRef;
return 0;
}

### 样例输出

new cylinder:
Center=[5,5], r=7.5, h=15
area=1060.29, volume=2650.72
pRef as a point:[5,5]
cRef as a Circle:Center=[5,5], r=7.5, area=176.714

### 代码如下

``````#include<stdio.h>
int main()
{
printf("new cylinder:
Center=[5,5], r=7.5, h=15
area=1060.29, volume=2650.72
pRef as a point:[5,5]
cRef as a Circle:Center=[5,5], r=7.5, area=176.714");
}``````