#include<iostream>
using namespace std;
class shape
{
public:
virtual double getarea()=0;
};
class Rectangele:public shape
{
private:
double longth;
double width;
public:
Rectangele(double a,double b)
{
longth=a;
width=b;
}
~Rectangele()
{cout<<"Rectangele释放"<<endl;}
double getarea()
{return longth*width;}
};
class circle:public shape
{
private:
double r;
public:
circle(double a)
{r=a;}
~circle()
{cout<<"circle释放"<<endl;}
double getarea()
{return 3.14*r*r;}
};
class square:public shape
{
private:
double a;
public:
square(double aa)
{a=aa;}
~square()
{cout<<"square释放"<<endl;}
double getarea()
{return a*a;}
};
void main()
{
Rectangele A(1,2);
cout<<A.getarea()<<endl;
circle B(2);
cout<<B.getarea()<<endl;
square C(3);
cout<<C.getarea()<<endl;
}