java 浮点数定点输出_java xmljava 浮点数定点输出_java_02View Code
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
public class Main {
public static void main(String args[])
{
Scanner cin=new Scanner(System.in);
double x1,y1,x2,y2;
DecimalFormat df = new DecimalFormat("0.00");
while(cin.hasNext())
{
x1=cin.nextDouble();
y1=cin.nextDouble();
x2=cin.nextDouble();
y2=cin.nextDouble();
double temp;
temp=Math.sqrt(((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));
System.out.println(df.format(temp));
}
}
}