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

PROGRAMMING:Area of a triangle_ two

Luz5年前 (2021-05-10)题库411
Input 3 sides of a triangle (a,b,c, all sides are floating numbers), determine if or not them could constitute a triangle. if so, calculating the area of the triangle; if cannot make a triangle, output "data error!".
The fomular is: $$area = √(s*(s-a)*(s-b)*(s-c) ) (among which: s=(a+b+c)/2)$$
![ Tim screenshot 20190319145526. PNG] (~ / 658719e7-af42-4e4a-b428-8cd437795f. PNG)
###Input format:
Input 3 floating numbers in one line, separate each other by ','.
###Output format:
Output the area hold 2 fraction digits or "data error!"
###Input sample 1:
```in
4,5,6
```
###Output sample 1:
```out
The area is 9.92
```
###Input sample 2:
```in
1,2,3
```
###Output sample 2:
```out
data error!
```






answer:If there is no answer, please comment