码迷,mamicode.com
首页 > 其他好文 > 详细

刘志博 作业 2.15

时间:2017-09-18 00:18:27      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:string   system.in   import   main   line   rgs   next   void   print   

import java.util.Scanner;
public class Ex {
       public static void main(String[] args) {
             Scanner Lf=new Scanner(System.in);
             double x1,x2,y1,y2;
             System.out.println("请键入X1的值:");
             x1 = Double.valueOf(Lf.nextLine());
             System.out.println("请键入X2的值:");
             x2 = Double.valueOf(Lf.nextLine());
             System.out.println("请键入Y1的值:");
             y1 = Double.valueOf(Lf.nextLine());
            System.out.println("请键入Y2的值:");
            y2 = Double.valueOf(Lf.nextLine());
            System.out.println("两个点之间的距离是:"+ Math.pow((Math.pow((x2 - x1),2)+Math.pow((y2 - y1),2)),0.5));

    }
}

刘志博 作业 2.15

标签:string   system.in   import   main   line   rgs   next   void   print   

原文地址:http://www.cnblogs.com/LiuZhibo999/p/7538456.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!