Пишет что -1 тоже должен учитываться, но в else он и учитывается...
package com.javarush.task.task04.task0442;
/*
Суммирование
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sA = reader.readLine();
int a = Integer.parseInt(sA);
String sB = reader.readLine();
int b = Integer.parseInt(sB);
String sC = reader.readLine();
int c = Integer.parseInt(sC);
String sD = reader.readLine();
int d = Integer.parseInt(sD);
String sE = reader.readLine();
int e = Integer.parseInt(sE);
int[] arr = {a, b ,c , d, e};
int number;
int sum = 0;
int q;
for (int i=0; i < arr.length; i++)
{
number = arr[i];
if (number != -1)
{
sum += arr[i];
}
else
{
q = i;
sum += arr[q];
System.out.println(sum);
break;
}
}
}
}