Residents of Malevia like to experiment with their rooms. Rooms can be triangular, rectangular, and circle-type. To calculate the area, they need a program that gets the type of room shape and the relevant arguments as input. The program should output the room area.
Malevians use 3.14 for π.
Input format used by the Malevians:
triangle
a
b
c
where a, b and c are lengths of triangle sides.
rectangle
a
b
where a and b are lengths of the rectangle sides.
circle
r
where r is a circle radius.
The input values (a, b, c, r) are double.
Math library may help you to solve this task.