pastebin

BufferedReader
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Main
  7. {
  8.         public static void main (string[] args) throws java.lang.exception
  9.         {
  10.                 bufferedreader r = new bufferedreader (new inputstreamreader (system.in));
  11.                 string s;
  12.                 while (!(s=r.readLine()).startsWith("42")) system.out.println(s);
  13.         }
  14. }
Parsed in 0.011 seconds