educoder practical training - earth data calculation breakthrough

Level 1: Earth Surface Area Calculation

mission details

The task of this level: Write a small program that can approximate the surface area of ​​the earth.

related information

In order to complete this task, you need to master:

1. Approximation and model building
2. Calculation formula of the earth's surface area

Approximation and Modeling
The Earth is not a regular object. First of all, it is not a perfect sphere, but an ellipsoid. To be precise, it is an oblate spheroid with slightly flattened poles and a slightly bulging equator; secondly, the Earth’s South Pole and North Pole are not symmetrical. Slightly concave; third, the earth's external terrain is undulating (this has an impact on measuring the earth's radius).
The radius of the earth refers to the distance from the center of the earth to its surface (mean sea level), which is about 6371.393 kilometers on average.
The earth is not a regular sphere. Strictly speaking, it cannot be calculated using the formula of a sphere. In order to simplify the problem, it is necessary to approximate that the earth is a regular sphere, and use a sphere as a model, and then use the formula of the surface area of ​​a sphere for approximate calculation.

Calculation formula for the surface area of ​​the earth The
formula for the surface area of ​​a sphere:
S=4πR^2

programming requirements

According to the prompt, supplement the code in the editor on the right, calculate and output the surface area of ​​the earth, the unit (10,000 square kilometers), and keep the result with up to 4 decimal places. In this question, the radius of the earth is calculated with 6371 kilometers.

Test instructions
The platform will test the code you write:

Expected output:

The earth's surface area is XXXX.XXXX million square kilometers
Tip:

The π value refers to the value of the constant PI in the math library,
and the unit is "ten thousand square kilometers

おすすめ

転載: blog.csdn.net/qq_41234663/article/details/130009582