getting data from the keybroad

public static String getString()
throws IOException{
              InputStreamReader isr =
               new InoutStreamReader(System,in);
               BufferedReader br = new BufferedReader(isr);
               String s = br.readLine();  
               return s;
}
public static char getChar() throws IOException{
               String s= getString();
               return s.charAt(0);
}
public static int getInt() throws IOException{
              String s = getString();
              return Integer.parseInt(s);
}
原文地址:https://www.cnblogs.com/cici-new/p/4006024.html