HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


090. 50422 - Area and Perimeter of different Shapes

Guest
• Discussion of problem (3)

Volume problems

• 055. 50355 - Bills of City Water Co...
• 060. 50583 - Max of 3 numbers
• 062. 50402 - Hello World!
• 063. 50547 - Close Pair
• 065. 50436 - Pocket Money
• 068. 50581 - The roots of a quadrati...
• 070. 50439 - Telephone Calls
• 080. 50478 - Letter Grades
• 090. 50422 - Area and Perimet...
• 100. 50532 - Close City
• 120. 50511 - Class Average
• 130. 50416 - Placing Dominoes on ...
• 140. 50417 - Fun Fair
• 150. 50500 - Find Student
• 222. 50302 - Paper Scissors Rock
• 260. 50460 - Median of 3 Numbers

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
bfs. Difficulty Alpha

Area and Perimeter of different Shapes

You will be given asked to chose a geometrical shape. (1: Circle, 2:Rectangle, 3: Isosceles Triangle) Calculate the area and perimeter of the selected object.

Question:
First ask for the Object Type;

  1. if 1 is given then ask for the radius and
    calculate the area and perimeter of the circle;
  2. if 2 is given then ask for the width and height and
    calculate the area and perimeter of the rectangle;
  3. if 3 is given then ask for the base and height of an isosceles Triangle
    calculate the area and perimeter of it

Input specification
You will be given an integer number (objType) where 1 ≤ objType ≤ 3, according to the given object type you will be given one (circle) or two integer numbers (rectangle or triangle).
Note: PI= 3.14159

Output specification
Find out the area and perimeter of the given shape. Your result should contain at most 3 decimal place after the floating point.

Sample Input I
  1
  5
Sample Input II
  3
  10 5
Sample Output I
  78.54 31.416
Sample Output II
  25 24.142


Для отправки решений необходимо выполнить вход.

www.contester.ru