BSG白山极客挑战赛

B君的圆锥
wwwwodddd (命题人)
基准时间限制:1 秒 空间限制:131072 KB 分值: 40
B君要用一个表面积为S的圆锥将白山云包起来。

B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。

注意圆锥的表面积包括底面和侧面。
Input
一行一个整数,表示表面积S。(1 <= S <= 10^9)
Output
一行一个实数,表示体积。
Input示例
8
Output示例

1.504506


代码:

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>

using namespace std;

const double PI=acos(-1.0);
int main()
{
    int s;
    while(~scanf("%d",&s))
    {
        double x=(s*(sqrt((1.0*s*PI)/2)))/(6*PI);///套用公式
        printf("%lf\n",x);
    }


    return 0;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值