• <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 閱讀(2060) 評(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伊人久久大香线蕉影院 | 国产精品久久国产精麻豆99网站| 中文字幕久久波多野结衣av| 久久天天躁狠狠躁夜夜2020一| 久久亚洲AV成人无码| 麻豆精品久久久久久久99蜜桃 | 久久成人18免费网站| 欧美激情精品久久久久久| 久久久久亚洲AV无码观看| 色8久久人人97超碰香蕉987| 久久久久久久尹人综合网亚洲| 久久精品国产只有精品2020| 亚洲午夜久久影院| 一本色道久久88综合日韩精品 | 久久久久综合网久久| 伊人久久大香线焦综合四虎| 四虎影视久久久免费观看| 亚洲精品乱码久久久久久| 久久福利青草精品资源站免费| 久久综合亚洲色HEZYO国产| 久久精品国产精品亚洲精品| 人人狠狠综合久久亚洲88| 亚洲国产婷婷香蕉久久久久久| 精品国产乱码久久久久久1区2区 | 久久人人爽人人爽人人片AV不 | 国产成人香蕉久久久久| 久久婷婷五月综合国产尤物app| 久久精品人成免费| 一本久道久久综合狠狠躁AV| 久久久中文字幕| 亚洲中文字幕无码久久2020 | 色8激情欧美成人久久综合电| 无码人妻精品一区二区三区久久久 | 99久久免费国产精精品| 国产精品久久久久久久app| Xx性欧美肥妇精品久久久久久| 人妻精品久久无码专区精东影业| 久久久WWW成人免费毛片| 久久精品国产亚洲网站| 精品久久久噜噜噜久久久| 东方aⅴ免费观看久久av|