import java.util.Scanner; public class Demo_1{ public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("输入 x1 和y1: "); System.out.print("输入 x2 和 y2: "); double b=input.nextDouble(); double d=input.nextDouble(); double a=input.nextDouble(); double c=input.nextDouble(); double y= (b-a)*(b-a)+(d-c)*(d-c); double distance = Math.pow(y, 0.5); System.out.print("The distance the two points is " + distance); } }
posted on 2017-09-18 12:30  华山论  阅读(123)  评论(0编辑  收藏  举报