Algorithm


Problem Name: beecrowd | 1011

Sphere

Adapted by Neilor Tonin, URI Brazil

Timelimit: 1

Make a program that calculates and shows the volume of a sphere being provided the value of its radius (R) . The formula to calculate the volume is: (4/3) * pi * R3. Consider (assign) for pi the value 3.14159.

Tip: Use (4/3.0) or (4.0/3) in your formula, because some languages (including C++) assume that the division's result between two integers is another integer. :)

Input

The input contains a value of floating point (double precision).

Output

The output must be a message "VOLUME" like the following example with a space before and after the equal signal. The value must be presented with 3 digits after the decimal point.

Input Samples Output Samples

3

VOLUME = 113.097

 

15

VOLUME = 14137.155

 

1523

VOLUME = 14797486501.627

 

Code Examples

#1 Code Example with C Programming

Code - C Programming




#include <stdio.h<
#include <stdio.h<
int main()
{
 int a;
 scanf("%i", &a);
 printf("VOLUME = %.3lf\n", (4 * 3.14159 * pow(a, 3)) / 3);

 return 0;
}


Copy The Code & Try With Live Editor

Input

x
+
cmd
3

Output

x
+
cmd
VOLUME = 113.097

#2 Code Example with C++ Programming

Code - C++ Programming




#include <cstdio>
#include <cmath>

int main()
{
 int a;

 scanf("%i", &a);
 printf("VOLUME = %.3lf\n", (4 * 3.14159 * pow(a, 3)) / 3);

 return 0;
}


Copy The Code & Try With Live Editor

Input

x
+
cmd
15

Output

x
+
cmd
VOLUME = 14137.155

#3 Code Example with Javascript Programming

Code - Javascript Programming


import java.util.Scanner;

public class Main {

 public static void main(String[] args) {
  double a;
  Scanner sc = new Scanner(System.in);
  a = sc.nextDouble();
  
  System.out.printf("VOLUME = %.3f\n", (4 * 3.14159 * Math.pow(a, 3.0)) / 3);
  
 }

}
Copy The Code & Try With Live Editor

Input

x
+
cmd
1523

Output

x
+
cmd
VOLUME = 14797486501.627

#4 Code Example with Python Programming

Code - Python Programming


raio = int(input())

pi = 3.14159

volume = float(4.0 * pi * (raio* raio * raio) / 3)

print("VOLUME = %0.3f" %volume)
Copy The Code & Try With Live Editor

Input

x
+
cmd
3

Output

x
+
cmd
VOLUME = 113.097

#5 Code Example with C# Programming

Code - C# Programming


printf("VOLUME = %.3lf\n", (4 * 3.14159 * pow(a, 3)) / 3);
Copy The Code & Try With Live Editor

Input

x
+
cmd
15

Output

x
+
cmd
VOLUME = 14137.155
Advertisements

Demonstration


Previous
#1680 Beecrowd Online Judge Solution 1680 Edge Solution in C, C++, Java, Js and Python
Next
#1012 Beecrowd Online Judge Solution 1012 Area Solution in C, C++, Java, Python and C#