1002. Stick
2014-02-11 21:46
375 查看
1002. Stick | ||||
| ||||
Time Limit: 1sec Memory Limit:32MB Description 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 machining, and leaves the second one at last. You 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 Copy sample input to clipboard 31210 Sample Output 2 Problem Source: ZSUACM Team Member |
相关文章推荐
- 1002. Stick
- 1001. 统计数字
- 1001. 统计数字
- NYOJ 68 三点顺序
- NSMutableURLRequest POST
- NYOJ 68 三点顺序
- NSMutableURLRequest POST
- 1000. MJ, Nowhere to Hide
- Powershell进阶学习(1) 浅谈Powershell学习方法
- Cache-Control
- 1009. 范围统计
- 互联网广告综述之点击率特征工程
- 修改Win7软件安装的默认路径以及把 Program Files 目录移动到非系统盘的方法
- linux守护进程编程
- 1007. Sorting Algorithm
- C++ 中关于 iostream、源文件命名约定以及运行 GNU (微软)编译器的几点说明
- Javascript讲解系列之一 Prototype原型链详解 推荐
- typedef函数指针用法
- 友元函数和友元类
- 1006. 奖学金