共回答了19个问题采纳率:94.7%
import java.util.Random;
public class Point {
private double x,y;
public Point() {
x=0;
y=0;
}
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
public static double getdis(Point p1,Point p2){
double x=p1.getX()-p2.getX();
double y=p1.getY()-p2.getY();
double len=Math.hypot(x, y);
return len;
}
public static void sort(Point[]p){
for(int i=0;i
1年前
9