Scanner scanner = new Scanner(System.in); int sum = 0; boolean isExit = false; while (!isExit) { if (scanner.hasNextInt()) { int number = scanner.nextInt(); sum = sum + number; } else if (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.equals("ENTER")) { isExit = true; } } } System.out.println(sum);}} Почему System.out.println(sum) вне цикла while? Какой тут командой выводится ENTER?