Evaluate the surface area and volume of the ball |
Difficulty level: A; running time limit: 1000 ms; running space limit: KB; code length limit: B |
Question description |
Enter a positive number not greater than 300 to indicate the radius of the ball and calculate the surface area and volume of the ball. |
Input |
There is only one positive number not greater than 300. |
Output |
The two positive numbers separated by spaces represent the surface area and volume of the ball respectively. |
Input example |
4 |
Output example |
200.96 267.947 |
Other Instructions |
The circumference rate is 3.14. The formula for calculating the surface area and volume of the ball, Baidu. By the way, it will certainly be useful in the future, you know! |
The formula for this question is a bit tricky and you have to check it yourself.
Sphere surface area = radius X radius x4x π.
Sphere volume = 4/3 x radius X π.
Set of formulas ---
The Code is as follows:
# Include <iostream> using namespace STD; int main () {Double R; CIN> r; cout <4*3.14 * r <"" <(4.0/3) * 3.14 * r; return 0 ;}
0018 --- obtain the surface area and volume of the ball