题目描述
Write a program which calculates the area and circumference of a circle for given radius r.
输入
A real number r is given.
输出
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.
题解
#include<bits/stdc++.h>
#define pi 3.14159265358979323846264338327950288419716939937510
using namespace std;
int main(){
long double r,s,c;
scanf(“%Lf”,&r);
c=2*pi*r;
s=pi*r*r;
printf(“%Lf %Lf”,s,c);
return 0;
}