POJ - 3737 UmBasketella (计算几何&&一阶求导)

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#define pi 3.1415926
using namespace std;
int main()
{
    double s;
    while(scanf("%lf", &s) != EOF)
    {
        double h = sqrt(2.0 * s / pi);
        double r = sqrt((s * s) / (pi * pi * h * h + 2.0 * s * pi));
        double v = pi * r * r * h / 3.0;
        printf("%.2lf\n%.2lf\n%.2lf\n", v, h, r);
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/Miracle_QSH/article/details/82192455