⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wordsearch.java

📁 在很大的一个词库中寻找所需的单词
💻 JAVA
字号:
/* WordPuzzle.java */

import java.io.*;

public class WordSearch 
{
/**
  *The main method of the whole project.
  *Calls SearchSolve to do the search.
  */
	public static void main(String[] args) throws IOException 
	{
		//////////
		BufferedReader br;
		String filename;
		SearchSolve solve;

		java.util.Date mydate;

		long beginTime,endTime;

		if(args.length!=2)
		{
			System.out.println("Error:please input filename.");
			return;
		}

        filename=args[0];
		
		try
		{
			System.out.println("\n================ your solution begins ================\n");
			// get the begin time
			mydate=new java.util.Date();
			beginTime=mydate.getTime();
			br=new BufferedReader(new FileReader(filename));
			solve=new SearchSolve();
			// pass output file name
			solve.outPutFile = args[1];
			solve.readText(br);
			solve.searchText();
			solve.output();
			// get the end time
			mydate=new java.util.Date();
			endTime=mydate.getTime();
			System.out.println("\n================ your solution ends =================\n");
			System.out.println("Time consumed: "+(endTime-beginTime)+" millisecondes.");
		}
		catch (IOException e)
		{
			System.out.println("Error:io error.");
		}
        ///////////处理其它的异常
		
	}
}//end of class

⌨️ 快捷键说明

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