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

PROGRAMMING:Find the sum of the distances from 10 points to the origin

Luz5年前 (2021-05-10)题库466
Find the sum of the distances from 10 points to the origin. Input the coordinates of 10 points, calculate and output the sum of the distances from these points to the origin. Define the function dist (x, y) to calculate the distance from any point (x, y) on the plane to the origin (0, 0). The return value type of the function is double.
###Input format:
Input 10 pairs of real numbers in a row, and each pair of real numbers corresponds to the abscissa and ordinate of a point.
###Output format:
In one line, output the value s of partial sum in the format of "distance = s", accurate to six decimal places. Please note that there is a space on the left and right of the equal sign. The calculation results should not exceed the double precision range.
###Input example:
```in
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9
```
###Output example:
```out
distance = 63.639610
```







answer:If there is no answer, please comment