首页 > 其他 > 详细

2.15

时间:2017-09-18 13:58:57      阅读:205      评论:0      收藏:0      [点我收藏+]
import java.util.Scanner;
public computerfile{
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter x1 and y1: ");
        System.out.print("Enter x2 and 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);
    }
}

2.15

原文:http://www.cnblogs.com/foreminent/p/7542522.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!