#include <iostream>
using namespace std;
class shape
{
昼月>泥鳅的做法
片段作文200字public:
扎辫子 virtual double area()=0;
};
施工申请class Rectangle:public shape
{
private:
double W,H;
给十年后的自己
public:
Rectangle(double w,double h)
{
W=w;
H=h;
}
double area()
{
return W*H;
农产品网络营销 }
};
const PI=3.14159;
class Circle:public shape
{
private:
double X,Y,R;
public:
Circle(double x,double y,double r)
{
X=x;
Y=y;
R=r;
}
double area()
{
return PI*R*R;
}
};
void main()睹物思人的意思是什么
{
Rectangle W(3,5);
shape *P;
P=&W;
cout<<P->area()<<endl;
Circle C(3,4,5);
shape &U=C;
cout<<U.area()<<endl;
}