1261: (2025)实验5-1-3 派生类

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:Imported
Submit:464 Solved:226

Description

定义一个基类Shape,在此基础上派生出RectangleCircle,二者都有getArea( )函数计算对象的面积,再使用Rectangle类创建一个派生类Square。在主函数中测试RectangleCircleSquare这三个类。

Input

Rectangle的长和宽、Circle的半径、Square的边长,测试数据有浮点数

Output

Rectangle、Circle和Square对应的面积。四舍五入到整数

Sample Input Copy

3 7 6 4

Sample Output Copy

21 113 16