master
dima 2024-11-13 17:09:55 +03:00
parent bf305d907e
commit 8f9ba6e1f6
1 changed files with 41 additions and 41 deletions

View File

@ -4,9 +4,7 @@ import java.util.Scanner;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or //TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter. // click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
Scanner scanner = new Scanner(System.in); Scanner scanner = new Scanner(System.in);
float number1 = scanner.nextFloat(); float number1 = scanner.nextFloat();
String operation = scanner.next(); String operation = scanner.next();
@ -18,9 +16,9 @@ public class Main {
String d = ":"; String d = ":";
String e = "^"; String e = "^";
if( operation != a && operation != b && operation != c && operation != d && operation != e) { if( operation != a && operation != b && operation != c && operation != d && operation != e) {
System.out.println("ошибка"); System.out.println("ошибка");
} }
if (":".equals(operation)) { if (":".equals(operation)) {
@ -49,6 +47,8 @@ public class Main {
if ("^".equals(operation)) { if ("^".equals(operation)) {
double power = Math.pow(number1, number2); double power = Math.pow(number1, number2);
System.out.println(power); System.out.println(power);
} }
} }
} }