find your present
Description
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 present, and their card numbers are , , , , .so your present will be the one with the card number of , because 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 (<=n<, and n is odd) at first. Following that, n positive integers will be given in a line, all integers will smaller than ^. These numbers indicate the card numbers of the presents.n = ends the input. Output
For each case, output an integer in a line, which is the card number of your present. Sample Input Sample Output #include<stdio.h>
void main()
{
long n,x,y,i;
while(scanf("%ld",&n)== && n)
{
x=;
for(i=;i<n;i++)
{
scanf("%ld",&y);
x^=y;
}
printf("%ld\n",x);
} }
find your present的更多相关文章
- 跳转时候提示Attempt to present on while a presentation is in progress
出现这种情况,例如:我在获取相册图片后,直接present到另一个页面,但是上一个页面可能还未dismiss,所以,要在获取相册图片的dismiss方法的complete的block里面写获取图片及跳 ...
- find your present (感叹一下位运算的神奇)
find your present (2) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Ot ...
- HTTP Status 400 - Required String parameter 'userName' is not present 错误
HTTP Status 400 - Required String parameter 'userName' is not present 错误 先mark 有时间详细写 参考链接: https:/ ...
- Linux 克隆虚拟机引起的“Device eth0 does not seem to be present, delaying initialization”
虚拟机Vmware上克隆了一个Red Hat Enterprise Linx启动时发现找不到网卡,如下所示,如果你在命令窗口启动网络服务就会遇到"Device eth0 does not s ...
- required string parameter XXX is not present
@RequestParam jQuery调用方式: deleteFile: function(filePath) { return ajax({ method: 'POST', url: '/cm/s ...
- 启动网卡报:Device eth0 does not seem to be present”解决办法
Device eth0 does not seem to be present”解决办法 : 用ifconfig查看发现缺少eth0,只有lo:用ifconfig -a查看发现多出了eth1的信息. ...
- 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 ...
- 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 ...
- 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配置文 ...
- 虚拟机解决Device eth0 does not seem to be present 问题。
Device eth0 does not seem to be present... 出现这个问题基本上是因为虚拟机是克隆的导致机器的mac网卡不一致,所以系统识别网卡失败:
随机推荐
- 云计算PAAS平台测试设计之镜像管理
下面是云计算PAAS平台页面概览: 今天我们要讲的是镜像管理页面的测试设计: 可以看到,这个页面主要有增删改查四个功能. 1. 查询镜像 (1)易用性:查看镜像查询界面,界面上各组件设计合理.美观.易 ...
- c-windows-1
< Back 我使用的是<windows程序设计>和VS 首先看到的第一个代码是: /*----------------------------------------------- ...
- C/C++笔试经典程序(二)
1.下面5个函数哪个能够成功进行两个数的交换? swap1传的是值的副本,在函数体内被修改了形参p.q(实际参数a.b的一个拷贝),p.q的值确实交换了,但是它们是局部变量,不会影响到主函数中的a和b ...
- 关于AS3获取当前URL和浏览器信息
原文链接: http://www.baidu.com/link?url=8-mS_wTlQi5MGvLQ8Oqf34wA-glS4roi0AmMswussY3kpkXoVUnOQQOaj-NGf2Ik ...
- 慕课网-安卓工程师初养成-2-9 Java中的自动类型转换
来源:http://www.imooc.com/code/1236 在 Java 程序中,不同的基本数据类型的数据之间经常需要进行相互转换.例如: , 代码中 int 型变量 score1 可以直接为 ...
- ORA-12518,TNS:listener could not hand off client connection
前几天在启动应用的时候,在控制台抛出了此异常信息!很明显是数据库方面的问题,不过具体是什么问题哪?百度了一下,网上关于此问题的信息还是有比较多,从异常的提示中我们也能看到是具体是和客户端的连接相关的问 ...
- java中单例类
class Singleton { private static Singleton instance; private Singleton(){} public static ...
- myecplise tomcat jdk
myeclipse是javaweb初学者或者工程师非常常用的软件.那么在MyEclipse中如何使用自己安装的JDK和tomcat呢.下面是JDK1.7+tomcat7.0+myeclipse10的j ...
- WWF3状态机工作流<WWF第七篇>
状态机是另外一种常见的工作流类型.它是以状态的变迁为驱动而进行业务流转的,是一定需要人为干预的,而不像顺序类型工作流那样可以按照事先设计好的业务流程一步一步依次执行下去. 一.状态机工作流范例 Sta ...
- TCP/IP之大明王朝邮差
一位大神的精华之作,原创2016-05-12 刘欣 来自码农翻身! 时间: 大明王朝天启四年, 清晨. 天色刚蒙蒙亮,我就赶着装满货物的马车来到了南城门,这里是集中处理货物的地方,一队一队的马车都来到 ...