从控制台读取Int和String
/**from 时代Java公众号 - N o w J a v a . c o m**/ //package com.nowjava; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] argv) throws Exception { System.out.println(readInt()); } private static BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(System.in)); public static int readInt() { int i; /** from 时代Java公众号**/ try { i = Integer.parseInt(readString()); } catch (NumberFormatException nfe) { i = readInt(); } return i; } public static String readString() { String s = ""; try { s = bufferedReader.readLine(); } catch (IOException io)