|
|
back to boardHello, here is listing. Locally it works and prints the result. Don't understand why it causes the Runtime Error. Thanks. import java.io.IOException; import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) throws IOException { 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); } } Try example as is - single line "1<space>5". Edited by author 11.01.2017 18:30 你为什么要readLine呢 readLine是读取一行,一行怎么能转换为int类型呢,你应该获取一个字符,而不是使用Readline因为这是读取一行 |
|
|