Advertisement
Guest User

Untitled

a guest
May 20th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class _04_Calculate_Expression {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         Double a = Double.parseDouble(scanner.next());
  8.         Double b = Double.parseDouble(scanner.next());
  9.         Double c = Double.parseDouble(scanner.next());
  10.  
  11.         Double f1 = Math.pow(((Math.pow(a, 2) + b * b) / (a * a - b * b)), (a + b + c) / Math.sqrt(c));
  12.         Double f2 = Math.pow((Math.pow(a, 2) + Math.pow(b, 2) - Math.pow(c, 3)), a - b);
  13.         Double diff = Math.abs((a + b + c) / 3 - (f1 + f2) / 2);
  14.  
  15.         System.out.printf("F1 result: %.2f; F2 result: %.2f; Diff: %.2f", f1, f2, diff);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement