• <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, 評(píng)論 - 24, 引用 - 0
            數(shù)據(jù)加載中……

            從一道簡(jiǎn)單題談程序設(shè)計(jì)的思維

            從一道簡(jiǎn)單題談程序設(shè)計(jì)的思維

            題目

             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ì)的分析以后再給出。

            參考資料

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

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

            評(píng)論

            # re: 從一道簡(jiǎn)單題談程序設(shè)計(jì)的思維  回復(fù)  更多評(píng)論   

            不錯(cuò) LZ加油
            2009-04-03 09:55 | Kven-KeRoX

            # re: 從一道簡(jiǎn)單題談程序設(shè)計(jì)的思維  回復(fù)  更多評(píng)論   

            xor
            2013-11-18 08:26 | E
            亚洲中文字幕久久精品无码喷水| 国产亚洲综合久久系列| 久久涩综合| 一本久道久久综合狠狠躁AV| 久久久亚洲AV波多野结衣| 欧美一区二区三区久久综| 国产情侣久久久久aⅴ免费| 国产精品久久久久乳精品爆| 久久精品极品盛宴观看| 国产国产成人精品久久| 四虎久久影院| 亚洲国产成人久久综合碰碰动漫3d| 国产精品伊人久久伊人电影| 久久精品国产日本波多野结衣| 久久亚洲美女精品国产精品| 欧美粉嫩小泬久久久久久久 | 人人妻久久人人澡人人爽人人精品| 久久这里的只有是精品23| 久久久女人与动物群交毛片| 日韩欧美亚洲国产精品字幕久久久| 久久久久人妻精品一区| 人人狠狠综合久久亚洲高清| 久久精品男人影院| 久久精品午夜一区二区福利| 亚洲国产成人久久精品99| 国产免费久久久久久无码| 国产欧美久久久精品| 无码人妻久久久一区二区三区| 久久久久国产一级毛片高清板| 97久久国产亚洲精品超碰热| 人妻久久久一区二区三区| 欧美久久久久久午夜精品| 久久免费视频6| 久久精品二区| 久久久久亚洲AV成人网人人网站 | 曰曰摸天天摸人人看久久久| 久久99久久99精品免视看动漫| 少妇无套内谢久久久久| 久久久久亚洲av综合波多野结衣| 麻豆av久久av盛宴av| 午夜精品久久久久9999高清|