📄 dpoint.java
字号:
public class DPoint implements Comparable
{
public int x;
public int y;
public DPoint(int x,int y)
{
this.x=x;
this.y=y;
}
public double distant(DPoint c)
{
return Math.sqrt(Math.pow((x-c.x),2)+Math.pow((y-c.y),2));
}
public int compareTo(Object e)
{
return x-((DPoint)e).x;
}
public String toString()
{
return "("+x+","+y+")";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -