あなたは以下のとおりです。 -
import java.util.Scanner;
public class Distance {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
double x1=0;
double x2=0;
double y1=0;
double y2=0;
double distance=0;
System.out.println("Enter the value of x1 : ");
x1=in.nextDouble();
System.out.println("Enter the value of y1 : ");
y1=in.nextDouble();
System.out.println("Enter the value of x2 : ");
x2=in.nextDouble();
System.out.println("Enter the value of y2 : ");
y2=in.nextDouble();
distance=Math.sqrt(Math.pow((x2-x1), 2)+Math.pow((y2-y1), 2));
System.out.printf("The distance between given coordinates is : %.5f",distance);
}
}
は[Jogesh JOBY](http://stackoverflow.com/users/6386498/jogesh-joby)と話をしてみて、彼は同じように、言葉を選んだ[尋ね(今削除されました)](http://stackoverflow.com/questions/37462988/print-the-distance-note-that-the-distance-between-two-points-x1-y1-and-x2-y2)question昨日。 –
宿題割り当てでなければならない – JohannisK
これは恥ずかしそうな宿題のダンプであるため、この質問をトピックとして閉じるよう投票しています。 –