Работает со всеми значениями, но выдаёт ошибку "-1 должен учитываться в сумме". В чем может быть проблема???
package com.javarush.task.task04.task0442;
import java.util.Scanner;
/*
Суммирование
*/
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 f = sc.nextInt();
while (f == -1){
int sum = a + b + c + d + f;
System.out.println(sum);
if (f == -1) {break;}
}
}
}