diff --git a/src/Main.java b/src/Main.java index 44ed138..eeeb6d6 100644 --- a/src/Main.java +++ b/src/Main.java @@ -12,6 +12,16 @@ public class Main { String operation = scanner.next(); float number2 = scanner.nextFloat(); System.out.print("Ответ:"); + String a = "+"; + String b = "-"; + String c = "*"; + String d = ":"; + String e = "^"; + + + if (operation != a && operation != b && operation != c && operation != d && operation != e) { + System.out.println("ошибка"); + } if (":".equals(operation)) { if (number2 != 0) { @@ -36,5 +46,9 @@ public class Main { float multiplication = number1 * number2; System.out.println(multiplication); } + if ("^".equals(operation)) { + double power = Math.pow(number1, number2); + System.out.println(power); + } } } \ No newline at end of file