Задача 4.Calculate Expression, Intro To Java
Дава ми Compile time erorr, моля дайте съвет как да подобря кода, за да мине, ето го и него:
import java.util.Scanner; import static java.lang.Math.*; public class Nums2To100 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); float a = Float.parseFloat(scanner.nextLine()); float b = Float.parseFloat(scanner.nextLine()); float c = Float.parseFloat(scanner.nextLine()); double f1 = pow(((pow(a,2) + pow(b,2)) / (pow(a,2) - pow(b,2))), ((a + b + c) / sqrt(c))); double f2 = pow((pow(a,2) + pow(b,2) - pow(c,3)), (a - b)); double dif = abs(((a + b + c) / 3) - ((f1 + f2) / 2)); System.out.printf("F1 result: %.2f;",f1); System.out.printf(" F2 result: %.2f;",f2); System.out.printf(" Diff:%.2f",dif); } }
}