Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedInputStream;
- import java.io.IOException;
- import java.io.PrintStream;
- public class Main {
- public static BufferedInputStream in = new BufferedInputStream(System.in);
- public static void main(String[] args) throws IOException {
- PrintStream out = new PrintStream(System.out);
- int n;
- while ((n = nextInt()) != 42)
- out.println(n);
- in.close();
- out.close();
- }
- public static int nextInt() throws IOException {
- int number = 0;
- int digit;
- while ((digit = in.read()) != '\r' && digit != -1)
- number = number*10 + digit - '0';
- if (digit == '\r')
- in.skip(1);
- return number;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement