налепила костылей, один из которых заведомо не правильный - цикл будет прекращаться на любом слове, а не на слове Enter и мне засчиталось... плохо это.
Как соединить использование console.nextInt и console.nextLine?
/*
Суммирование
*/
public class Solution {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
boolean ENTER = false;
while(console.hasNextInt() && !ENTER)
{
int a = console.nextInt();
int b = console.nextInt();
int c = console.nextInt();
int d = console.nextInt();
int z = (a + b + c + d);
//String x = console.nextLine();
//ENTER = x.equals("ENTER");
System.out.print(z);
}
}
}