import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String year = scanner.nextLine(); double p = Double.parseDouble(scanner.nextLine()), h = Double.parseDouble(scanner.nextLine()), game = ((48 - h) * 3 / 4) + h + p * 2 / 3; if (year.equals("leap")) { game *= 1.15; } System.out.println((int) game); } } ИЛИ: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String year = scanner.nextLine(); double p = Double.parseDouble(scanner.nextLine()), h = Double.parseDouble(scanner.nextLine()), game = (((48 - h) * 3 / 4) + h + p * 2 / 3) * (year.equals("leap") ? 1.15 : 1); System.out.println((int) game); } }