import java.io.*; /* * If you are interested... * * This class is an example of a Java class to read and process * input from the keyboard. It does absolutely no error handling * and blatently defeats Java's error handling -- so don't feed it * badly. * * Please also feel free to modify it or to discard it. */ class Keyboard { private BufferedReader keyb; /* * This is the constructor for the keyboard class, it initializes * the keyboard buffer */ public Keyboard() { try { keyb = new BufferedReader (new InputStreamReader(System.in)); } catch (Exception e) {}; } /* * This function reads a floating point number from the keyboard * WARNING: It does no error detection or management */ public float getFloat() { try { return Float.valueOf(keyb.readLine()).floatValue(); } catch (Exception e) {}; return -1; /* This is _really_ bad */ } /* * This function reads a string from the keyboard * WARNING: It does no error detection or management */ public String getString() { try { return keyb.readLine(); } catch (Exception e) {}; return ""; /* This is _really_ bad */ } /* * This function reads an int from the keyboard * WARNING: It does no error detection or management */ public int getInt() { try { return Integer.parseInt(keyb.readLine()); } catch (Exception e) {}; return -1; /* This is _really_ bad */ } }