подскажите пожалуйста, в чем ошибка, так как при выводе сумма отображается корректно, но проверку не проходит, ругается что сумма подсчитана не правильно
package com.javarush.task.pro.task04.task0403;
import java.util.Scanner;
/*
Суммирование
*/
public class Solution {
public static void main(String[] args) {
Scanner text = new Scanner(System.in);
int a = 0;
while (text.hasNextLine())
{
while (text.hasNextInt())
{
int x = text.nextInt();
a = a+x;
}
String y = text.nextLine();
System.out.println(y);
}
System.out.println(a);
}
}