ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1000. A+B Problem

DanLong Runtime Error in Java [2] // Problem 1000. A+B Problem 9 Mar 2015 18:17
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class AB {
    public static void main(String[] args) throws Exception
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(reader.readLine());
        int b = Integer.parseInt(reader.readLine());
        System.out.println(a+b);

    }
}
sonechko_ann Re: Runtime Error in Java [1] // Problem 1000. A+B Problem 16 Mar 2015 15:29
У меня такое же решение. Тоже не принимает...
Andrew Sboev [USU] Re: Runtime Error in Java // Problem 1000. A+B Problem 16 Mar 2015 19:20
Numbers are located at the same line. So, first call of readLine() give you "a b", and second - null.