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

Runtime Error in Java
Posted by DanLong 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);

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