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

PROGRAMMING:Output triangle area and perimeter

Luz5年前 (2021-05-10)题库405
This problem requires programming, according to the three sides of the input triangle $$a $, $$B $$, $$C $$, calculate and output the area and perimeter. Note: in a triangle, the sum of any two sides is greater than the third side. Calculation formula of triangle area: $$area = [sqrt {s (S-A) (S-B) (S-C)} $$, where $$s = (a + B + C) / 2 $$.
###Input format:
The input is three positive integers, representing the three sides of the triangle respectively $$a $, $$B $$, $$C $$.
###Output format:
If the input edge can form a triangle, in a row, follow the
```
Area = area; Perimeter = perimeter
```
The format of output, retain two decimal places. Otherwise, output
```
These sides do not correspond to a valid triangle
```
###Input sample 1:
```in
5 5 3
```
###Output sample 1:
```out
area = 7.15; perimeter = 13.00
```
###Input example 2:
```
1 4 1
```
###Output example 2:
```
These sides do not correspond to a valid triangle
```






answer:If there is no answer, please comment