#P5708. 【深基2.习2】三角形面积
【深基2.习2】三角形面积
Triangle Area
Problem Source
Luogu P5708
Problem Description
A triangle has side lengths , , ; its area is , where . Input these three numbers and compute the area of the triangle, rounded to decimal place.
Input Format
The first line contains three real numbers , separated by spaces.
Output Format
Output one real number: the area of the triangle, kept to decimal place.
Sample Input
3 4 5
Sample Output
6.0
Hint
- Heron's formula was used in the previous problem: compute first, then apply the formula. The new thing here is the output: keep 1 decimal place.
- The sides are decimals, so choose the right type.
- Check against the sample:
3 4 5→6.0.
The data guarantees a valid triangle can be formed, with , and each side having at most decimal places on input.