zoukankan      html  css  js  c++  java
  • poj 3737 UmBasketella

                                                                                        UmBasketella
    Time Limit: 1000MS Memory Limit: 65536K
    Total Submissions: 1117 Accepted: 300

    Description

    In recent days, people always design new things with multifunction. For instance, you can not only use cell phone to call your friends, but you can also use your cell phone take photographs or listen to MP3. Another example is the combination between watch and television. These kinds of multifunction items can always improve people's daily life and are extremely favored by users.

    The company Mr. Umbrella invented a new kind umbrella "UmBasketella" for people in Rainbow city recently and its idea also comes from such multifunction--the combination of umbrella and daily necessities. This kind of umbrella can be used as a basket and you can put something you want to carry in it. Since Rainbow city rains very often, such innovative usage is successful and "UmBasketella" sells very well. Unfortunately, the original "UmBasketella" do not have an automatic volume control technology so that it is easily damaged when users try to put too many things in it. To solve this problem, you are needed to design an "UmBasketella" with maximum volume. Suppose that "UmBasketella" is a cone-shape container and its surface area (include the bottom) is known, could you find the maximum value of the cone?

    Input

    Input contains several test cases. Eash case contains only one real number S, representing the surface area of the cone. It is guaranteed that 1≤S≤10000.

    Output

    For each test case, output should contain three lines.
    The first line should have a real number representing the maximum volume of the cone.
    Output the height of the cone on the second line and the radius of the bottom area of the cone on the third line.
    All real numbers should rounded to 0.01.

    Sample Input

    30

    Sample Output

    10.93
    4.37
    1.55

    Source

    [Submit]   [Go Back]   [Status]   [Discuss]

     

    #include <iostream>
    #include 
    <cmath>
    using namespace std;
    #define PI acos(-1.0)

    int main()
    {
        
    double r , h , s , v , l;
        
    while (cin >> s)
        {
            r 
    = sqrt (s / (4 * PI));
            l 
    = s / (PI * r) - r;
            h 
    = sqrt (l * l - r * r);
            v 
    = 1.0 / 3 * PI * r * r * h;
            printf (
    "%.2lf\n" , v);
            printf (
    "%.2lf\n" , h);
            printf (
    "%.2lf\n" , r);
        }
        
    return 0;
    }
  • 相关阅读:
    一个老博士的2015年终总结 (二)
    一个老博士的2015年终总结 (一) -- 偶然发现自己竟然在博客园发过帖子
    yolov3源码分析keras(二)损失函数计算
    yolov3源码分析keras(一)数据的处理
    [转载]HDMI on ZedBoard with Petalinux.
    基于zedBoard的手势识别及桌面操控系统_项目论文
    VGA显示SDRAM内容_1——DE1-SOC学习笔记(3)
    Avalon Slave外设简单实现——DE1-SOC学习笔记(2)
    Cyclone V 与 Avalon-MM资料整理——DE1-SOC学习笔记(1)
    ESP8266开发课堂之
  • 原文地址:https://www.cnblogs.com/forever4444/p/1458768.html
Copyright © 2011-2022 走看看