006. Distance

006. Distance
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Find the distance between two 2D points. Remember that the distance formula is 
d=(x2x1)2+(y2y1)2
math.sqrt will calculate the square root of a number. Also, you also have to add the line  import math at the top of the program.
Input
The first two lines contain the X and Y coordinates of the first point respectively. The second two lines contain the X and Y coordinates of the second point respectively. Each coordinate will have an integer value between -1000 and 1000, inclusive.
Output
A double N representing the distance between the two points
Examples
input
Copy
1
1
2
2
output
Copy
1.4142135623730951
input
Copy
1
1
1
1
output
Copy
0.0

Comments

Popular posts from this blog

How to pass parameters in webhook?

Access and modify all the resources of our Wiki.js using WikiJS API

Fahrenheit to Celsius