版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011815404/article/details/89522042
题目
B君要用一个表面积为S的圆锥将白山云包起来。
B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。
注意圆锥的表面积包括底面和侧面。
输入
一行一个整数,表示表面积S。(1 <= S <= 10^9)
输出
一行一个实数,表示体积。
输入样例
8
输出样例
1.504506
思路:已知圆锥表面积 S,最大体积 V=S*sqrt*(S/(72*pi))
源程序
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 1000000+5;
const int dx[] = {-1,1,0,0};
const int dy[] = {0,0,-1,1};
using namespace std;
int main() {
int s;
scanf("%d",&s);
printf("%lf\n",s*1.0*sqrt(s/(72.0*PI)));
return 0;
}