Здравствуйте, прошу посмотреть на мой код и подсказать почему не проходит проверку по предпоследнему пункту:
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num1 = sc.nextInt(), num2 = sc.nextInt(), num3 = sc.nextInt(), num4 = sc.nextInt();
sc.nextLine();
String w = sc.nextLine();
while (w.equals("ENTER")) {
int res = num1 + num2 + num3 + num4;
System.out.println(res);
w = "0";
}
}
}
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 num1 = sc.nextInt(), num2 = sc.nextInt(), num3 = sc.nextInt(), num4 = sc.nextInt();
sc.nextLine();
String w = sc.nextLine();
while (w.equals("ENTER")) {
int res = num1 + num2 + num3 + num4;
w = "0";
System.out.println(res);
}
}
}