题目链接:POJ 3737——UmBasketella
题意:给出圆锥体的表面积,求当圆锥体积最大时,圆锥的体积、高和底面半径各位多少(用double)
分析:师哥说用三分,然而我不会。。。。
那么,让我们一起愉快的推公式吧!
嗯~~~~虽然字忒丑吧,但好歹是个过程。。。。
//#include<bits/stdc++.h>
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<math.h>
using namespace std ;
typedef long long ll;
#define MAXN 105
#define INF 0x3f3f3f3f
#define MALL (Bithrnode *)malloc(sizeof(Bithrnode));
const double T = 3.1415926;
int main()
{
double s;
while(cin >> s)
{
double r = sqrt(s*1.0/(4*T));
double ans = (s-T*r*r*1.0)/(T*r);
double h = sqrt(ans*ans - r*r);
double v = T*r*r*h*1.0/3;
printf("%.2f\n%.2f\n%.2f\n", v, h, r);
}
return 0;
}