TwoPointDistance


Submit solution

Points: 5 (partial)
Time limit: 40.0s
Memory limit: 64M

Authors:
Problem type

變化題


計算兩點間的距離

\[√((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))\]

小提示:需用到數學函式 Math.sqrt()
輸入限制: 均>0

Input

輸入兩點的xy值

Output

計算出來的結果

Sample Input 括號僅為提示

2 (x1)
0 (y1)
5 (x2)
6 (y2)

Sample Output

6.708203932499369

Comments


  • 0
    guest_2  commented on Oct. 6, 2023, 3:54 p.m.

    Math.sqrt()使用示範:

    double n = Math.sqrt(4);

    輸出 n = 2.0