import java.util.Scanner;
public class Jisuanjl{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
System.out.print("Enter x1 and y1:");
double x1=input.nextDouble();
double y1=input.nextDouble();
Scanner input1=new Scanner(System.in);
System.out.print("Enter x2 and y2:");
double x2=input1.nextDouble();
double y2=input1.nextDouble();
double l=Math.sqrt(Math.pow((x2-x1),2)+Math.pow((y2-y1),2));
System.out.println("The distance between the two point is "+l);
}
}
原文:http://www.cnblogs.com/kongtingting/p/7536880.html