思路:
求圆的面积: S = PI * r2. 题目已给 PI = atan(1.0) * 4 或 PI=3.14159265358979323.
1 #include <iostream> 2 #include <cstdio> 3 #include <cmath> 4 using namespace std; 5 6 const double PI = atan(1.0)*4; 7 8 int main() 9 { 10 ios::sync_with_stdio(false); 11 cin.tie(0); 12 13 int r; 14 cin >> r; 15 printf("%.7f\n", PI * r * r); 16 17 return 0; 18 }
原文:https://www.cnblogs.com/AntonLiu/p/12246691.html