При проверке пишет что -1 не учитывается, хотя когда компилирую все считает
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 sn1 = reader.readLine();
String sn2 = reader.readLine();
String sn3 = reader.readLine();
int nn1 = Integer.parseInt(sn1);
int nn2 = Integer.parseInt(sn2);
int nn3 = Integer.parseInt(sn3);
control(nn1, nn2, nn3);//напишите тут ваш код
}
public static void control(int a, int b, int c) {
int [] d = new int [] {a,b,c};
int sum = 0;
for(int i = 0; i < 3; i++)
{
if(d[i] == -1)
{
for(int j = 0; j < 3; j++)
{
sum = sum + d[j];
}
}
}
System.out.println(sum);
}
}