In the new year party, everybody will get a "special present".Now it's your turn to get your special present, a lot of presents now putting on the desk, and only one of them will be yours.Each present has a card number on it, and your present's card number will be the one that different from all the others, and you can assume that only one number appear odd times.For example, there are 5 present, and their card numbers are 1, 2, 3, 2, 1.so your present will be the one with the card number of 3, because 3 is the number that different from all the others.

Input

The input file will consist of several cases. 
Each case will be presented by an integer n (1<=n<1000000, and n is odd) at first. Following that, n positive integers will be given in a line, all integers will smaller than 2^31. These numbers indicate the card numbers of the presents.n = 0 ends the input.

Output

For each case, output an integer in a line, which is the card number of your present.

Sample Input

5
1 1 3 2 2
3
1 2 1
0

Sample Output

3
2

Hint

use scanf to avoid Time Limit Exceeded

// 0^n=n, n^n=0. And "you can assume that only one number appear odd times"
 #include<stdio.h>
int main()
{
int n, num, m;
while(scanf("%d", &n), n)
{
m=;
while(n--)
{
scanf("%d", &num);
m^=num;
}
printf("%d\n", m);
}
return ;
}

7K - find your present (2)的更多相关文章

  1. 跳转时候提示Attempt to present on while a presentation is in progress

    出现这种情况,例如:我在获取相册图片后,直接present到另一个页面,但是上一个页面可能还未dismiss,所以,要在获取相册图片的dismiss方法的complete的block里面写获取图片及跳 ...

  2. find your present (感叹一下位运算的神奇)

    find your present (2) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  3. HTTP Status 400 - Required String parameter 'userName' is not present 错误

    HTTP Status 400 - Required String parameter 'userName' is not present 错误 先mark  有时间详细写 参考链接: https:/ ...

  4. Linux 克隆虚拟机引起的“Device eth0 does not seem to be present, delaying initialization”

    虚拟机Vmware上克隆了一个Red Hat Enterprise Linx启动时发现找不到网卡,如下所示,如果你在命令窗口启动网络服务就会遇到"Device eth0 does not s ...

  5. required string parameter XXX is not present

    @RequestParam jQuery调用方式: deleteFile: function(filePath) { return ajax({ method: 'POST', url: '/cm/s ...

  6. 启动网卡报:Device eth0 does not seem to be present”解决办法

    Device eth0 does not seem to be present”解决办法 : 用ifconfig查看发现缺少eth0,只有lo:用ifconfig -a查看发现多出了eth1的信息. ...

  7. jQuery 跨域访问的三种方式 No 'Access-Control-Allow-Origin' header is present on the reque

    问题: XMLHttpRequest cannot load http://v.xxx.com. No 'Access-Control-Allow-Origin' header is present ...

  8. js跨域访问,No 'Access-Control-Allow-Origin' header is present on the requested resource

    js跨域访问提示错误:XMLHttpRequest cannot load http://...... No 'Access-Control-Allow-Origin' header is prese ...

  9. sudo: no tty present and no askpass program specified(转)

    sudo: no tty present and no askpass program specified 2012-11-30 09:30 5040人阅读 评论(1) 收藏 举报 修改sudo配置文 ...

随机推荐

  1. 无法启动此程序,因为计算机中丢失VCRUNTIME140.dll 尝试重新安装此程序以解决此问题

    最近在阿里云上租了个服务器,想借此发布一些自己制作的网页.于是就打算安装一下环境,考虑到搭建动态网站所要安装的环境比较多,于是就选择了wampserver这样一个集成环境的安装. 由于我的服务器很新( ...

  2. 使用JavaScript制作页面效果3

    一. 1.下拉列表:select对象 属性: option[ ]:选项数组 selectedIndex:被选中选项的索引号 length:选项总数 方法: add(option对象,添加位置):增加选 ...

  3. .net core 自动生成文档

    如下图自动生成显示接口文档注释

  4. log4j2 Filter用法详解

    主要说下组合过滤器 CompositeFilter ,比较常用 <Filters> 是组合过滤器额标签,它包含的子标签是具体的过滤器,这三个具体过滤器分别是日志等级过滤器,正则表达式过滤器 ...

  5. Delphi Exif

    这久要用到读取JPG 的 Exif 信息,先是在盒子里下了个Demo,但是那个太老了,是2003年的,后来下载了个CCR 1.5.1是可以使用了,但是我个人用的是Delphi 2007,似乎CCR 1 ...

  6. Gradle 打多渠道包

    使用gradle 打多渠道包记录经验如下图可见,每个渠道是包含debug 和realse版本的.通过打印BASE_URL 发现在渠道和版本中都可以修改BuildConfig的常量,这样一次可以打出多个 ...

  7. SpringCloud系列八:Zuul 路由访问(Zuul 的基本使用、Zuul 路由功能、zuul 过滤访问、Zuul 服务降级)

    1.概念:Zuul 路由访问 2.具体内容 在现在为止所有的微服务都是通过 Eureka 找到的,但是在很多的开发之中为了规范微服务的使用,提供有一个路由的处理控制组件:Zuul,也就是说 Zuul ...

  8. springboot+vue前后端分离,nginx代理配置 tomcat 部署war包详细配置

    1.做一个小系统,使用了springboot+vue 基础框架参考这哥们的,直接拿过来用,链接https://github.com/smallsnail-wh/interest 前期的开发环境搭建就不 ...

  9. 两个对象的 hashCode()或equals相同,equals或hashCode不一定相同--《案例演示》

    两个对象的 hashCode()或equals相同,equals或hashCode不一定相同 1.两个对象的equals相同,hashCode不一定相同 在重写equals方法,未重写hashCode ...

  10. Jquery实现点击表格行变色!

    时隔一年左右,学习了新的知识,从尝试Linux部署项目,网络安全,至后端开发,然后用起了Jquery, 而且是必须要做.也让自己见识可能会更广泛一些.对于一个刚毕业的大学生而言.方正我是没有用过jqu ...