What's wrong?
package com.javarush.task.task04.task0442;
/*
Суммирование
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
Scanner scan = new Scanner(System.in);
int number;
int result = 0;
while(true) {
number = scan.nextInt();
if (number !=-1)
result += number;
else
System.out.println(result -1);
}
}
}