что ей не так? не проходит условие по сумме
package com.javarush.task.task04.task0442;
/*
Суммирование
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader x = new BufferedReader(new InputStreamReader(System.in));
int sum = 0;
while (true){
int a = Integer.parseInt(x.readLine());
if (a != -1){
sum = sum + a; }
else {
break;}
System.out.println(sum);
}
}
}