AcWing 616. 两点间的距离 - Java
原题链接
简单
作者:
KYCygni
,
2021-03-01 08:55:27
,
所有人可见
,
阅读 335
Java 代码
/**4 MDKJ
"Nothing is impossible. Some things are just less likely than others."
- Jonathan Winters
*/
import java.util.Scanner;
public class Main
{
public static void main (String[] args)
{
Scanner cin = new Scanner(System.in);
double x1 = cin.nextDouble();
double y1 = cin.nextDouble();
double xd = cin.nextDouble() - x1;
double yd = cin.nextDouble() - y1;
System.out.println(String.format("%.4f", Math.sqrt(xd * xd + yd * yd)));
}
}