zzulioj 1010: Find the perimeter and area of a circle

Title description
Enter the radius of the circle and find the circumference and area of ​​the circle. It is required to define the PI as the following macro constant
#define PI 3.14159
Input
Input the value of the radius r, which is a real number.
Output
Output one line, including perimeter and area. Separate the data with a space, and keep two decimal places after the data.
Sample input Copy
3
Sample output Copy
18.85 28.27

#include<stdio.h>
#define PI 3.14159
int main()
{
    
    
	double r;
	scanf("%lf",&r);
	printf("%.2lf %.2lf",2*PI*r,PI*r*r);
	return 0;
}

Guess you like

Origin blog.csdn.net/m0_53024529/article/details/112665749