亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

HDU1056:HangOver

系統(tǒng) 2352 0
Problem Description
How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overhang the bottom one by half a card length, and the bottom one overhang the table by a third of a card length, for a total maximum overhang of 1/2 + 1/3 = 5/6 card lengths. In general you can make n cards overhang by 1/2 + 1/3 + 1/4 + ... + 1/(n + 1) card lengths, where the top card overhangs the second by 1/2, the second overhangs tha third by 1/3, the third overhangs the fourth by 1/4, etc., and the bottom card overhangs the table by 1/(n + 1). This is illustrated in the figure below.

HDU1056:HangOver ?

The input consists of one or more test cases, followed by a line containing the number 0.00 that signals the end of the input. Each test case is a single line containing a positive floating-point number c whose value is at least 0.01 and at most 5.20; c will contain exactly three digits.

For each test case, output the minimum number of cards necessary to achieve an overhang of at least c card lengths. Use the exact output format shown in the examples.
?

?

Sample Input
1.00 3.71 0.04 5.19 0.00
?

?

Sample Output
3 card(s) 61 card(s) 1 card(s) 273 card(s)
?


?

    #include <stdio.h>



int main()

{

    double a;

    while(~scanf("%lf",&a),a)

    {

        double b = 0,i;

        for(i = 1;b<a;i++)

        {

            b+=1/(i+1);

        }

        printf("%.0lf card(s)\n",i-1);

    }

    return 0;

}


  


?

?

?

HDU1056:HangOver


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 成人影院一区二区三区 | 在线久综合色手机在线播放 | 亚洲精品久久久久久久久久久网站 | 丰满放荡岳乱妇91www | 久久精品国产夜色 | 欧美视频日韩专区午夜 | 中文字幕日本在线观看 | 中文字幕亚洲色图 | 亚洲欧美色综合一区二区在线 | 日日嗷| 伊伊综合| 国产精品原创巨作无遮挡 | 欧美激情影院 | 香蕉视频在线免费播放 | 成人在线日韩 | 最新国产午夜精品视频成人 | 精品午夜寂寞影院在线观看 | 久久精品国产在爱久久 | 99国产大尺度福利视频 | 99视频福利| 久久久久免费精品视频 | 亚洲成在人线中文字幕 | 热99re久久精品天堂vr | 日本亚洲欧美国产日韩ay高清 | 精品免费福利视频 | 日本欧美一区二区三区 | 欧美成人性色生活片天天看 | 欧美亚洲综合网 | 欧美日韩高清观看一区二区 | 六月婷婷啪啪 | 欧美夜夜操 | 久久精品免费视频6 | 国产成人精品日本亚洲网站 | 婷婷综合视频 | 国产69精品久久久久9999 | 最新国产精品久久精品 | 日韩美女va在线毛片免费知 | 亚洲午夜久久久精品影院视色 | 国产香蕉视频在线播放 | 免费不卡毛片 | 黄色在线观看网站 |