Stick

1200. Stick

Constraints

Time Limit: 1 secs, Memory Limit: 32 MB

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

31210

Sample Output

2


// stick.cpp
#include <iostream>
#include <set>
using namespace std ;
int main (){
	int flag = 0 ; cin >> flag ;

	while(flag != 0){
		set<int> stickes ;
		int first ; cin >> first ; stickes.insert(first) ;

		while(flag -- > 1 ){
			int x ; cin >> x ;
			if( stickes.count(x) ){
				stickes.erase(x) ;
			}
			else{
				stickes.insert(x) ;
			}
		}

		set<int>::iterator iter ;
		for ( iter = stickes.begin() ; iter != stickes.end() ; ++iter )
		{
			cout << *iter << endl ;
		}
		
		cin >> flag ;		
	}
	
}







Game Stick Lite是一种便携式的微型游戏控制台,通常设计用于连接电视或其他显示设备以玩视频游戏。这类产品一般集成了操作系统、控制器以及可能的游戏库,旨在提供一个简易设置即可游玩的解决方案。 关于Game Stick Lite的具体介绍和使用方法如下: 1. **硬件特点** - Game Stick Lite体积小巧,便于携带。 - 内置无线模块支持蓝牙或Wi-Fi功能来连接互联网或者配对其他外设如额外的手柄。 - 可能配备USB端口供充电或是扩展存储用途。 2. **软件环境** - 运行特定的操作系统,可能是定制版Linux或者其他轻量化OS,专为运行游戏优化。 - 提供应用商店让用户下载更多游戏和其他应用程序。 - 支持流媒体服务,使玩家能够观看在线内容。 3. **安装与配置** - 插入HDMI接口至显示器完成物理连接。 - 接通电源启动装置;首次开机可能会引导用户进行初始设置流程。 - 根据屏幕提示更新固件确保最佳性能体验。 - 设置网络连接以便访问云端资源和服务。 4. **玩游戏** - 利用手中的遥控器/手柄选择预装好的游戏列表里的项目开始娱乐。 - 对于某些型号的支持下,还可以通过手机APP充当虚拟键盘或触摸板辅助操控。 请注意,由于市场上存在不同品牌和版本的Game Stick Lite类产品,具体特性和操作指南会有所差异。建议参考官方提供的手册获得最准确的帮助信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值