package max; import java.util.Scanner; public class max { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b, sum; System.out.print("Введите 1-ое число: "); a = sc.nextInt(); System.out.print("Введите 2-ое число: "); b = sc.nextInt(); sum = a+b; boolean isExit = false; while(!isExit){ System.out.println("Расчёт: " + sum); System.out.print("Для остановки введите 'enter': "); String stopsl = sc.nextLine(); isExit = stopsl.equals("enter"); } } }