public class Solution { public static void main(String[] args) { //напишіть тут ваш код Scanner scan = new Scanner(System.in); int sum = 0; int x; boolean check; while (scan.hasNextInt()) { x = scan.nextInt(); sum += x; } if (scan.hasNextLine()){ String Finish = scan.nextLine(); boolean check = (finish.equals("ENTER")); if (check) System.out.println(sum); }