/* Положительное и отрицательное число */ import java.util.Scanner; import java.io.IOException; public class Solution { public static void main(String[] args) throws Exception { //напишите тут ваш код Scanner number = new Scanner(System.in); if(number.hasNextInt()){ int x = number.nextInt(); checkInt(x); }else{ System.out.println("Введено не верное значение!"); } } public static void checkInt(int a){ if(a==0){ System.out.println(a); System.exit(0); } if(a>0){ System.out.println(a*2); System.exit(0); } if(a<0){ System.out.println(a+1); System.exit(0); } } } Хотя в intellij idea всё работает.