I wrote this code in the IDEA an there it works fine for me but I can`t verify this task. When I try to compile it in the web IDE it throws an exception and I don`t know why.
I would be pleased if someone could help me.
package de.codegym.task.task05.task0530;
import java.io.*;
/*
Chef, hier passiert gerade etwas seltsames
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//schreib hier deinen Code
int sum = 0;
while (true) {
String test = reader.readLine();
if (test.equals("summe")) {
System.out.println("Summe = " + sum);
break;
} else {
int zahl = Integer.parseInt(test);
sum = sum + zahl;
}
}
reader.close();
}
}