📄 70fabd0bd965001b1748b1d06439a30d
字号:
package distance;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;
import java.lang.Math;
public class Test {
//public static int NumOfPoints;
public static void main(String[] args) throws IOException{
//int NumOfPoints = (int) Math.pow(2,3);
//Random random1 = new Random(100);
//double num = 10*(new Random()).nextDouble();
//System.out.println("n is:" + NumOfPoints);
//System.out.println("the num is:" + random1.nextDouble());
//System.out.println("the wanted num is:" + num);
//System.out.println("plz input the value of n:");
//int n = (int)System.in.read();
/*用 BufferedReader 包装 System.in,以便更方便的读取输入*/
/*主要是为了使用 readLine() 方法来读取*/
//BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//String n = reader.readLine().trim();
//int nn = Integer.parseInt(n);
//System.out.println("n is:" + n);
//System.out.println("nn is:" + nn);
//int NumOfPoints = (int) Math.pow(2,nn);
//int NumOfPoints = (int) Math.pow(2,Integer.parseInt(reader.readLine().trim()));
//System.out.println("NumOfPoints is:" + NumOfPoints);
ProducingPoints d = new ProducingPoints();
int num = d.getNumOfPoints();
Point[] ad = new Point[num];
ad = d.getPoints(num);
for(int i = 0; i < num; i++){
System.out.println("num " + i + " x:" + ad[i].getXCoordinate()+ " y:" + ad[i].getYCoordinate());
}
ShortestDistance sd = new ShortestDistance();
sd.findShortestDistance(ad,0,ad.length);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -