Ошибка " -1 должно учитываться в сумме."
package com.javarush.task.task04.task0442;
/*
Суммирование
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
String s1 = reader.readLine();
int n1 = Integer.parseInt(s1);
String s2 = reader.readLine();
int n2 = Integer.parseInt(s2);
String s3 = reader.readLine();
int n3 = Integer.parseInt(s3);
String s4 = reader.readLine();
int n4 = Integer.parseInt(s4);
String s5 = reader.readLine();
int n5 = Integer.parseInt(s5);
//if (n1==-1 || n2==-1 || n3==1 || n4==-1 || n5==-1){
// System.out.println(n1+n2+n3+n4+n5);
// }
for (int i=1; i>0; i--){
if (n1==-1 || n2==-1 || n3==1 || n4==-1 || n5==-1){
System.out.println(n1+n2+n3+n4+n5);
}
}
}
}