Advertisement
Guest User

Untitled

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