-->
当前位置:首页 > 题库

PROGRAMMING:Three classes are derived from the abstract base class shape

Luz5年前 (2021-05-10)题库485
Declare the abstract base class shape, and derive three classes from it: circle, rectangle, triangle. Output three areas with one function.
###Input format:
Enter five numbers in a row, the radius of the circle, the height and width of the rectangle, the height and bottom of the triangle, separated by a space
###Output format:
Circle area, rectangle area, triangle area, 2 significant digits after decimal point, each area occupies one line.
###Input example:
Here is a set of inputs. For example:
```in
3 3 4 3 4
```
###Output example:
The corresponding output is given here. For example:
```out
twenty-eight point two seven
twelve
six
```







answer:If there is no answer, please comment