Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. package com.company;
  2. import java.util.Scanner;
  3. import java.lang.Math;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner num = new Scanner(System.in);
  9.         int a, p;
  10.         double m1, m2, pow2 = 2, pow3 = 3, G;
  11.         a = num.nextInt();
  12.         p = num.nextInt();
  13.         m1 = num.nextDouble();
  14.         m2 = num.nextDouble();
  15.         G = 4 * (Math.pow((Math.PI), pow2)) * Math.pow(a, pow3) / Math.pow(p, pow2) * (m1 + m2);
  16.         System.out.print(G);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement