9.12作业

 2.15
import java.util.Scanner;

public class test { public static void main(String[] args) { Scanner Hy=new Scanner(System.in); double x1,x2,y1,y2; System.out.println("请键入X1的值:"); x1 = Double.valueOf(Hy.nextLine()); System.out.println("请键入X2的值:"); x2 = Double.valueOf(Hy.nextLine()); System.out.println("请键入Y1的值:"); y1 = Double.valueOf(Hy.nextLine()); System.out.println("请键入Y2的值:"); y2 = Double.valueOf(Hy.nextLine()); System.out.println("两个点之间的距离是:"+ Math.pow((Math.pow((x2 - x1),2)+Math.pow((y2 - y1),2)),0.5)); } }
原文地址:https://www.cnblogs.com/Archon-Cty/p/7535019.html