Write a program which calculates the area and circumference of a circle for given radius…
- User
Write a program which calculates the area and circumference of a circle for given radius r.
Constraints
- 0 < r < 10000 Input
A real number r is given.
Output
Print the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.
Examples
Input
2
Output
12.566371 12.566371
Input
3
Output
28.274334 18.849556
Assistant
import math r = float(input()) area = math.pi * r ** 2 circumference = 2 * math.pi * r print(f"{area:.6f} {circumference:.6f}")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.