public class Solution { public static void main(String[] args) throws Exception { //напишите тут ваш код Scanner in = new Scanner(System.in); int a = in.nextInt(); boolean x = false; while (x) { if (a != -1) { a += a; continue; } else if (a == -1) { System.out.println(-1); break; } } } } How can I realize constant waiting for input in the console? before -1 is entered?
int a = in.nextInt();in the cycle - Alexey Shimansky