Всем привет, выводит два результат и не выполняет предпоследнее требование
package com.javarush.task.pro.task04.task0403;
import java.util.Scanner;
/*
Суммирование
*/
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum = 0;
while(sc.hasNextInt())
{
int a = sc.nextInt();
sum = sum + a;
}
boolean isExit = false;
while (!isExit)
{
String s = sc.nextLine();
isExit = s.equals("ENTER");
System.out.println(sum);
}
}
}