| Calculate the circumference and area of the circle |
| Difficulty level: A; running time limit: 1000 ms; running space limit: KB; code length limit: B |
| Question description |
| Enter a positive number to indicate the radius of a circle, and calculate and output the circumference and area of the circle. |
| Input |
| A positive number (which may have a decimal point) |
| Output |
| Two positive numbers separated by a space, representing the circumference and area of the circle respectively |
| Input example |
| 2.5 |
| Output example |
| 15.708 19.6349 |
| Other Instructions |
| The number of inputs cannot exceed 1000, and the circumference rate is 3.14159. |
This question is still a set of formulas. You do not need to add more BB codes directly.
Pay attention to the question of π, just take 3.14159.
The Code is as follows:
# Include <iostream> # include <cmath> using namespace STD; int main () {double A, B, C; CIN> A; B = 2 * a * 3.14159; C = A * a * 3.14159; cout <B <"" <C <Endl; return 0 ;}
0016 --- calculate the circumference and area of the circle