package dibo; import java.io.*; import java.lang.*; public class Terminal { public static PrintStream out = System.out; public static PrintStream output = System.out; public static DataInputStream input = new DataInputStream(System.in); public static String eingabe = ""; // Einlesen eines char public static char readChar() { try { eingabe = input.readLine(); return eingabe.charAt(0); } catch(Exception e) { return '\0'; } } // Einlesen eines short public static short readShort() { try { eingabe = input.readLine(); Integer String_to_short = new Integer(eingabe); return (short)String_to_short.intValue(); } catch (Exception e) { return 0; } } // Einlesen eines int public static int readInt() { try { eingabe = input.readLine(); Integer String_to_int = new Integer(eingabe); return String_to_int.intValue(); } catch (Exception e) { return 0; } } // Einlesen eines long public static long readLong() { try { eingabe = input.readLine(); Long String_to_long = new Long(eingabe); return String_to_long.longValue(); } catch (Exception e) { return 0L; } } // Einlesen eines float public static float readFloat() { try { eingabe = input.readLine(); Float String_to_float = new Float(eingabe); return String_to_float.floatValue(); } catch (Exception e) { return 0.0F; } } // Einlesen eines double public static double readDouble() { try { eingabe = input.readLine(); Double String_to_double = new Double(eingabe); return String_to_double.doubleValue(); } catch (Exception e) { return 0.0; } } // Einlesen eines string public static String readString() { try { return input.readLine(); } catch (Exception e) { return ""; } } }