2000: Simple Problem IV
| Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
|---|---|---|---|---|---|
| 1s | 10240K | 1729 | 685 | Standard |
Give three vertexs of a triangle, calculate the perimeter of the triangle.
Input
There are several test cases in the input file. The first line of the input file is an integer T, indicates the number of test cases.Then following T lines, each line contain six floating-point numbers:Ax Ay Bx By Cx Cy
indicates the coordinates of the three vertexs.
Output
For each test case print the perimeter in a single line. The result should be rounded to the nearest thousandth.Sample Input
2 0.0 0.0 0.0 1.0 1.0 0.0 1.0 1.0 2.0 0.0 3.0 1.0
Sample Output
3.414 4.828
This problem is used for contest: 3
Submit / Problem List / Status / Discuss
本文介绍了一个简单的程序设计问题:给定三个顶点坐标,如何计算三角形的周长。通过使用距离公式和循环结构,文章提供了一种有效的方法来解决这个问题,并给出了具体的代码实现。
1636

被折叠的 条评论
为什么被折叠?



