标签:style blog ar color os sp java for on
描述
2
0 0 0 1
0 1 1 0
1.00
1.41
1 import java.text.NumberFormat; 2 import java.util.Arrays; 3 import java.util.Scanner; 4 5 public class Main { 6 public static void main(String[] args) { 7 Scanner scanner=new Scanner(System.in); 8 int T; 9 double x1; 10 double y1; 11 double x2; 12 double y2; 13 double distance; 14 15 T=scanner.nextInt(); 16 17 while(true){ 18 if(T==0) 19 break; 20 T--; 21 22 x1=scanner.nextDouble(); 23 y1=scanner.nextDouble(); 24 x2=scanner.nextDouble(); 25 y2=scanner.nextDouble(); 26 27 distance=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); 28 distance=Math.sqrt(distance); 29 30 System.out.printf("%.2f\n",distance); 31 } 32 } 33 }
标签:style blog ar color os sp java for on
原文地址:http://www.cnblogs.com/zqxLonely/p/4132016.html