hu3201 Build a Fence 解题报告

链接:http://acm.hdu.edu.cn/showproblem.php?pid=3201

思路: 周长一定, 圆的面积最大~

View Code
 1   #include <cmath>
 2   #include <cstdio>
 3   using namespace std;
 4   const double PI = acos(-1.0);
 5   int n;
 6   int main() {
 7       while (scanf("%d", &n) != EOF) {
 8           if (n == 0) break;
 9           printf("%.2lf\n", (n / PI) * (n / PI) * PI * 0.5);
10       }
11       return 0;
12   }
原文地址:https://www.cnblogs.com/jian1573/p/2682177.html