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

📄 complete3_4.java

📁 北京大学出版社的
💻 JAVA
字号:
package questions.c3;
import java.io.*; 
import java.util.*;
public class Complete3_4 {
   public static void main( String[] args) 
                            throws IOException { 
      // input file may be supplied in the first argument 
      InputStream istream; 
      if ( args.length > 0 ) {
         File inputFile = new File( args[0] );
         istream = new FileInputStream(inputFile);
      } else {
      // if no file name, use standard input stream 
         istream = System.in;
      }
      BufferedReader br
         = new BufferedReader(
           new InputStreamReader(istream) );
      String Title = "";  
      String line;
      boolean found = false;
      while (( line = br.readLine() ) != null) {
         // get token from the file, one at a time 
         StringTokenizer tokens 
            = new StringTokenizer( line );
         while ( tokens.hasMoreTokens() ) {
            String word = tokens.nextToken();
            //  
            // your code goes here
            //
         }
         // you may have to add code here
      }
      if ( Title.length() == 0 ) {
         System.out.println( "HTML file has no title" );
      } else {
         System.out.println( Title );
      }
   }  
} 

⌨️ 快捷键说明

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