Live2D

java练习---5

//程序员:罗元昊  2017.9.17

package demo;
import java.util.Scanner;
public class Ly {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);

    System.out.print("输入x1和y1:");
    double x1 =input.nextDouble();
    double y1 =input.nextDouble();

    System.out.print("输入x2和y2:");
    double x2 =input.nextDouble();
    double y2 =input.nextDouble();

    double x =Math.pow((x2 - x1),2);
    double y =Math.pow((y2 - y1),2);
    System.out.println("两个点之间的距离是:"+ Math.pow((x+y),0.5));
  }
}

 

posted @ 2017-09-18 12:07  Mr丶L  阅读(235)  评论(0编辑  收藏  举报