почему запускается вечный цикл?
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 a = 0;
boolean input = false;
while (!input) {
if (sc.hasNextInt()) {
int b = sc.nextInt();
a += b;
} else if (sc.hasNextLine()) {
String c = sc.nextLine();
if (c.equals("EXIT")) {
input = true;
}
}
}
System.out.println(a);
}
}