1.转载自一个
https://www.cpe.ku.ac.th/~jim/java-io.html
2.工具代码
class Reader { static BufferedReader reader; static StringTokenizer tokenizer; /** call thReader method to initialize reader for InputStream */ static void init(InputStream input) { reader = new BufferedReader( new InputStreamReader(input) ); tokenizer = new StringTokenizer(""); } /** get next word */ static String next() throws IOException { while ( ! tokenizer.hasMoreTokens() ) { //TODO add check for eof if necessary tokenizer = new StringTokenizer( reader.readLine() ); } return tokenizer.nextToken(); } static int nextInt() throws IOException { return Integer.parseInt( next() ); } static double nextDouble() throws IOException { return Double.parseDouble( next() ); } }
3.比如蓝桥杯——安慰奶牛问题,从60分变成了100分。