d06a0b057666001b10aeff84f2824f58

来自「在eclipse下开发的求平面上两点之间的最短距离。通过随机在平面上生成无数个点」· 代码 · 共 43 行

TXT
43
字号
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 = d.getPoints(num);
		for(int i = 0;i < num;i++){
			System.out.println("num i" + "x:" + ad[i].getXCoordinate()+ "y:" + ad[i].getYCoordinate());
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?