Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Principal {
  4.  
  5.     public static void main(String[] args)
  6.     {
  7.         Scanner s=new Scanner(System.in);
  8.        
  9.         System.out.println("A: ");
  10.         double a = s.nextDouble();
  11.         System.out.println("Beta: ");
  12.         double beta = s.nextDouble();
  13.         System.out.println("B: ");
  14.         double b = s.nextDouble();
  15.        
  16.         double resul = beta*2*Math.PI/360;
  17.        
  18.         double r = Math.sqrt(a*a+2*a*b*Math.cos(resul)+b*b);
  19.        
  20.         System.out.println(r);
  21.     }
  22.    
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement