修改了很多次,还是错误
晕 好晕 我晕
import java.util.Scanner;
class Point {
int x,y;
Point(int x,int y){
this.x =x;
this.y =y;
}
double Distance(Point p){
double r = Math.sqrt((p.x-x)(p.x-x)+(p.y-y)(p.y-y));
return r;
}
}
public class Main {
public static void main(String[] args) {
Point p1,p2;
int x1,y1,x2,y2;
Scanner sc = new Scanner(System.in);
x1 = sc.nextInt();
y1 = sc.nextInt();
x2 = sc.nextInt();
y2 = sc.nextInt();
p1 = new Point(x1,y1);
p2 = new Point(x2,y2);
System.out.println(p1.Distance(p2));
}
}