• <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
            97久久香蕉国产线看观看| 久久久精品午夜免费不卡| 精品久久久无码21p发布| 欧美午夜精品久久久久免费视| 久久A级毛片免费观看| 久久精品国产精品亚洲人人| 精品久久久久久国产| 久久久久久a亚洲欧洲aⅴ| 色偷偷88欧美精品久久久| 国产精品青草久久久久婷婷| 亚洲国产天堂久久综合| 97久久精品人人澡人人爽| 亚洲精品tv久久久久久久久| 久久高清一级毛片| 久久国产精品久久国产精品| 国产成人无码精品久久久性色 | 久久久久亚洲AV无码专区网站 | 久久国产精品成人免费 | 7777久久亚洲中文字幕| 免费精品国产日韩热久久| 亚洲狠狠久久综合一区77777| 一本久久知道综合久久| 日日狠狠久久偷偷色综合96蜜桃| 久久被窝电影亚洲爽爽爽| 一本色道久久综合狠狠躁| 久久精品综合网| 日本五月天婷久久网站| 久久精品18| 久久免费99精品国产自在现线| 香港aa三级久久三级| 亚洲午夜久久久精品影院| 激情伊人五月天久久综合 | 亚洲精品高清国产一久久| 国产精品久久99| 久久国产精品-久久精品| 国产午夜精品理论片久久影视| 国产亚洲精品美女久久久| 久久精品视频免费| 国产高清国内精品福利99久久| 精品国产综合区久久久久久| 久久国产午夜精品一区二区三区|