Guest User

Untitled

a guest
Jul 31st, 2012
38
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.BufferedInputStream;
  2. import java.io.IOException;
  3. import java.io.PrintStream;
  4.  
  5. public class Main {
  6.     public static BufferedInputStream in = new BufferedInputStream(System.in);
  7.     public static void main(String[] args) throws IOException {
  8.         PrintStream out = new PrintStream(System.out);
  9.         int n;
  10.         while ((n = nextInt()) != 42)
  11.             out.println(n);
  12.         in.close();
  13.         out.close();
  14.     }
  15.    
  16.     public static int nextInt() throws IOException {
  17.         int number = 0;
  18.         int digit;
  19.         while ((digit = in.read()) != '\r' && digit != -1)
  20.             number = number*10 + digit - '0';
  21.         if (digit == '\r')
  22.             in.skip(1);
  23.         return number;
  24.     }
  25. }
RAW Paste Data