Friday, 10 February 2012

Codechef -> Practice -> Easy -> LifeUniverseAndEverything



Solution :



import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author XCoder
 */
class LifeUniverseAndEverything {

    public static void main(String[] args) throws IOException {
        int i = 0;
        while ((i = IOMain.readIntLine()) != 42) {
            System.out.println(i);
        }
    }
}

class IOMain {

    private static BufferedInputStream bis = new BufferedInputStream(System.in);
    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public static int readIntLine() throws IOException {
        return Integer.parseInt(br.readLine());
    }

    public static long readLongLine() throws IOException {
        return Long.parseLong(br.readLine());
    }
}

No comments:

Post a Comment