#include<iostream>//函数形参不能和私有变量名相同,运行时编译器会有歧义出错 using namespace std; class shape { public: virtual float getarea() { return 0.0; } }; class retangle:public shape { int l,r; public: void setretangle(int x,int y) { l=x; r=y; } virtual float getarea() { return l*r; } }; class circle :public shape { int r; public: void setcircle(int d) { r=d; } float virtual getarea() { return r*r*3.14; } }; class square:public shape { int a; public: void setsquare(int e) { a=e; } float virtual getarea() { return a*a; } }; int main() { int l,r,a,b; cin>> l >> r>>b >>a; retangle x; circle y; square z; x.setretangle(l, r); y.setcircle(b); z.setsquare(a); cout <<x.getarea()<<endl; cout <<y.getarea()<<endl; cout <<z.getarea()<<endl; return 0; }