首页 > ACM题库 > HDU-杭电 > hdu 2944 Find the Perimeter待解决[解题报告]C++
2014
02-24

hdu 2944 Find the Perimeter待解决[解题报告]C++

Find the Perimeter

问题描述 :

If there is a point P inside or outside a triangle ABC, so that three triangles ABP, ACP, and BCP have equal perimeters, we say P is the perimeter center of triangle ABC, the perimeter of ABP, ACP and BCP is denoted by Q(ABC).

For example, in an equilateral triangle with each side 10 in figure 1, the P at its center satisfies the above condition and Q(ABC)=21.54701 (=10+20/sqrt(3)).

输入:

Input contains several cases. Each case has one line containing three integers a, b, c, indicating the lengths of the respective sides of a triangle. Note that 0 < a, b, c ≤ 100. The input is terminated by three zeros.

输出:

Input contains several cases. Each case has one line containing three integers a, b, c, indicating the lengths of the respective sides of a triangle. Note that 0 < a, b, c ≤ 100. The input is terminated by three zeros.

样例输入:

10 10 10
30 40 50
18 17 15
1 2 3
0 0 0

样例输出:

21.54701
120.00000
36.54972
-1


  1. [email protected]