main.java

来自「实现垂直水平线计算交点的算法」· Java 代码 · 共 37 行

JAVA
37
字号
package ex3_intersection;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;


public class main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		Intersection i=new Intersection();
		try {
			FileInputStream fr=new FileInputStream("data_ex3_intersection\\data3.txt");
			i.Intersect(fr);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		FileWriter fw=new FileWriter("data_ex3_intersection\\result3.txt");
		fw.write(Integer.toString(i.total_num)+'\n');
		fw.flush();
		for(int k=0;k<i.al.size();k++)
		{
			cord temp=(cord) i.al.get(k);
			fw.write(temp.x+","+temp.y+'\n');
			fw.flush();
		}

	}

}

⌨️ 快捷键说明

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