this program is work correctly but still not passed testing , what to do?

public class Solution { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));

    while(true)
    {

        String a1 = reader.readLine();
        String b1 = reader.readLine();
        int a = Integer.parseInt(a1);
        int b = Integer.parseInt(b1);

        if(a==-1 || b==-1)
        {
            System.out.print(a+b);
            break;
        }
        else

        System.out.print(a + b);
        System.out.println();

    }
}

}

asked 29 Jul '15, 04:48

Mohammad%20Abu%20Bakr%20Chaudhry's gravatar image

Mohammad Abu...
11
accept rate: 0%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×36
×8
×4

Asked: 29 Jul '15, 04:48

Seen: 855 times

Last updated: 29 Jul '15, 04:48