Вроде программа все считает правильно, но третье условие не проходит, пишет, что -1 должен входить в сумму. Собственно у меня в результате так и получается. Не пойму, в чем загвоздка.
package com.javarush.task.task04.task0442;
/*
Суммирование
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();
int e = sc.nextInt();
while (true) {
int sum = a+b+c+d+e;
if ((a==-1)||(b==-1)||(c==-1)||(d==-1)||(e==-1))
System.out.println(sum);
break;
}
//напишите тут ваш код
}
}