• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 6, 文章 - 0, 評論 - 24, 引用 - 0
            數(shù)據(jù)加載中……

            從一道簡單題談程序設(shè)計的思維

            從一道簡單題談程序設(shè)計的思維

            題目

             Stick
            Problem 

            Anthony has collected a large amount of sticks for manufacturing chopsticks. In order to simplify his job, he wants to fetch two equal-length sticks for machining at a time. After checking it over, Anthony finds that it is always possible that only one stick is left at last, because of the odd number of sticks and some other unknown reasons. For example, Anthony may have three sticks with length 1, 2, and 1 respectively. He fetches the first and the third for machinning, and leaves the second one at last. Your task is to report the length of the last stick.

            Input

            The input file will consist of several cases.
            Each case will be presented by an integer n (1 <= n <= 100, and n is odd) at first. Following that, n positive integers will be given, one in a line. These numbers indicate the length of the sticks collected by Anthony.
            The input is ended by n = 0.

            Output

            For each case, output an integer in a line, which is the length of the last stick.

            Sample Input
            3
            1
            2
            1
            0
            Sample Output
            2

            讀者可先行思考,詳細(xì)的分析以后再給出。

            參考資料

            郭嵩山、張子臻、王磊、湯振東著  國際大學(xué)生程序設(shè)計競賽例題解(五)  電子工業(yè)出版社

            posted on 2009-03-29 15:35 yuyang7 閱讀(2069) 評論(2)  編輯 收藏 引用 所屬分類: 程序設(shè)計競賽

            評論

            # re: 從一道簡單題談程序設(shè)計的思維  回復(fù)  更多評論   

            不錯 LZ加油
            2009-04-03 09:55 | Kven-KeRoX

            # re: 從一道簡單題談程序設(shè)計的思維  回復(fù)  更多評論   

            xor
            2013-11-18 08:26 | E
            日韩人妻无码一区二区三区久久| 久久成人国产精品一区二区| 久久99精品国产麻豆宅宅| 国产aⅴ激情无码久久| 久久亚洲精品成人AV| 久久精品亚洲欧美日韩久久| 亚洲中文字幕无码一久久区| 国产精品丝袜久久久久久不卡| 奇米影视7777久久精品人人爽| 国产成人精品久久| 久久91精品综合国产首页| 精品久久久久久亚洲精品| 亚洲伊人久久成综合人影院 | 青青青国产精品国产精品久久久久| 国产—久久香蕉国产线看观看 | 国产福利电影一区二区三区,免费久久久久久久精 | 久久久女人与动物群交毛片| 国産精品久久久久久久| 久久精品无码午夜福利理论片| 亚洲精品乱码久久久久久蜜桃| 老司机国内精品久久久久| 色8久久人人97超碰香蕉987| 热久久视久久精品18| 久久精品中文字幕有码| 日韩欧美亚洲综合久久影院d3| 77777亚洲午夜久久多人| 亚洲日韩欧美一区久久久久我| 久久精品中文字幕有码| 国产精品日韩欧美久久综合| 国产精品丝袜久久久久久不卡 | 精品无码久久久久久久久久| 国产精品久久影院| 久久国产乱子伦精品免费强| 精品国产一区二区三区久久久狼 | 思思久久99热免费精品6| 国产精品热久久毛片| 久久久久国产一区二区| 久久人人爽人人爽人人片AV东京热| 精品久久久久久无码国产| 久久狠狠一本精品综合网| 欧美久久一级内射wwwwww.|