0018 --- obtain the surface area and volume of the ball

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.