From b7bffafa5bc7aab821534687661e538f7d764594 Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Tue, 23 Jul 2024 09:00:29 -0300 Subject: [PATCH] Solve Sphere in java --- solutions/beecrowd/1011/1011.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 solutions/beecrowd/1011/1011.java diff --git a/solutions/beecrowd/1011/1011.java b/solutions/beecrowd/1011/1011.java new file mode 100644 index 00000000..5f7d2ca9 --- /dev/null +++ b/solutions/beecrowd/1011/1011.java @@ -0,0 +1,17 @@ +import java.util.Scanner; +import java.lang.Math; + +public class Main { + public static void main(String args[]) { + Scanner input = new Scanner (System.in); + + float r; + double pi = 3.14159; + + while (input.hasNextInt()) { + r = input.nextInt(); + + System.out.printf("VOLUME = %.3f\n", 4.0 / 3.0 * pi * Math.pow(r, 3)); + } + } +}