All pastes #914641 Raw Edit

Mine

public text v1 · immutable
#914641 ·published 2008-02-23 01:37 UTC
rendered paste body
public class Test {

    public static void main(String[] args) throws Exception {
       System.out.println(Integer.parseInt(readLn(100)));
    }

    static String readLn(int maxLg) { //utility function to read from stdin
        {
            byte lin[] = new byte[maxLg];
            int lg = 0, car = -1;
            
            try {
                while (lg < maxLg) {
                    car = System.in.read();
                    if ((car < 0) || (car == '\n')) {
                        break;
                    }
                    lin[lg++] += car;
                }
            } catch (IOException e) {
                return (null);
            }
            if ((car < 0) && (lg == 0)) {
                return (null);
            } // eof
            return (new String(lin, 0, lg));
        }
    }
}