C language: Sequence Structure 3 (ball volume)
Time limit (Common/Java): 1000 ms/3000 Ms running memory limit: 65536 Kbyte
Total submissions: 880 pass the test: 610
Description
Write a program, input the ball to the radius, calculate and output the volume of the ball. The circumference rate is 3.14159.
Input
Ball to radius.
Output
The volume of the ball. Note: Keep the three decimal places and wrap the lines after the output.
Sample Input
10
Sample output
4188.787
# Include <stdio. h>
# Define PI 3.14159
Void main ()
{
Int R;
Float X;
Scanf ("% d", & R );
X = (4./3) * pI * r * R;
Printf ("%. 3f", X );
}
# Include <stdio. h>
Int main ()
{Double R, V;
Scanf ("% lf", & R );
V = 3.14159*4/3 * r * R;
Printf ("%. 3lf \ n", V );
Return 0;
}
# Include <stdio. h>
# Define PI 3.14159
Int main ()
{
Double R, V;
Scanf ("% d", & R );
V = (4./3) * pI * r * R;
Printf ("%. 3f", V );
}