Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- import java.lang.Math;
- public class Main {
- public static void main(String[] args) {
- Scanner num = new Scanner(System.in);
- int a, p;
- double m1, m2, G;
- a = num.nextInt();
- p = num.nextInt();
- m1 = num.nextDouble();
- m2 = num.nextDouble();
- G = 4 * (Math.pow((Math.PI), 2)) * Math.pow(a, 3) / Math.pow(p, 2) * (m1 + m2);
- System.out.print(G);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement