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

PROGRAMMING:JMU Python - finding the area and perimeter of triangle

Luz5年前 (2021-05-10)题库470
Input three sides a, B, C of triangle, calculate and output area and perimeter. Suppose that the three sides of the input triangle are legitimate shaping data.
Calculation formula of triangle area:
![ 111.png](~/311e2ad2-960b-4c4b-bafb-037c2808b1f6.png)
Where s = (a + B + C) / 2.
```
Import math # import math library
Math. Sqrt (x) # call sqrt function to realize square root operation, X represents the data of required value
```
###Input format:
Enter one data for each line, representing one edge of the triangle.
###Output format:
`Area = area; Perimeter = perimeter ', area and perimeter to 2 decimal places
###Input example:
```in
three
four
five
```
###Output example:
```out
area=6.00; perimeter=12.00
```







answer:If there is no answer, please comment