Description
Given a circle with radius R, please calculate the area of this circle.
Input
The input contains a real number R(0.1 <= R <= 100)
Output
Output the area of the circle in a line. The answer should be rounded to 8 digits after the decimal point.
Sample Input
0.564189583547
Sample Output
1.00000000
Hint
you can assume PI = 3.14159265358979
Submission
answer.cpp
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
double R;
cin>>R;
cout<<setprecision(8)<<fixed<<3.14159265358979*R*R<<endl;
return 0;
}
Standard Answer
answer.cpp
#include <iostream>
#include <iomanip>
using namespace std;
const double PI = 3.14159265358979;
int main()
{
double r; cin >> r;
cout << fixed << setprecision(8) << r * r * PI << endl;
return 0;
}