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网卡不一致,所以系统识别网卡失败:
随机推荐
- Android 进阶 Fragment 介绍和使用 (二)
管理fragment 因为FragmentManager的API是在Android 3.0,也即API level 11开始引入的,所以对于之前的版本,需要使用support library中的Fra ...
- python-appium练习编写脚本时遇到问题
遇到问题: 1.安卓4.2及以下系统无法识别resource-id属性 只能用text属性识别 2.输入中文无法识别 脚本最顶部增加#coding=utf-8 3.对象无法识别resource-id属 ...
- xcode7.3 升级 xcode8.0 后权限设置问题(升级xcode 8.0 后构建版本不显示问题)
xcode7.3 升级 xcode8.0 后权限设置问题(升级xcode 8.0 后构建版本不显示问题) 前两天为了适配 iOS10 的系统 我将xcode 7.3 升级到了 xcode 8.0 但是 ...
- [译]使用AES 256以达到SSL/TLS安全最大化
原文链接:https://luxsci.com/blog/256-bit-aes-encryption-for-ssl-and-tls-maximal-security.html 原文发表时间:201 ...
- windows bat 文件
windows下的bat文件即批处理文件或批处理脚本,英文为BATCH, BAT文件是无格式的文本文件. 在命令提示下键入批处理文件的名称,或者双击该批处理文件,系统就会调用Cmd.exe按照该文件 ...
- 在代码中调用 mvc 4 api
mvc 4 api 的调用有很多种,最常见也最简单的一种是 用 ajax 的方式在前端界面中调用, 如果是在后台代码中调用 ,是要复杂一些,以下是 以 post 的方式调用 api 的封装好的方法: ...
- [前端 4] 使用Js实现图片上传预览
导读:今天做图片上传预览,刚开始的做法是,先将图片上传到Nginx,然后重新加载页面才能看到这个图片.在这个过程中,用户一直都看不到自己上传的文件是什么样子.Ps:我发现我真的有强迫症了,都告诉我说不 ...
- C++著名程序库的比较和学习经验 (转)
转自:http://www.open-open.com/lib/view/open1328670468108.html 内容目录: 1.C++各大有名库的介绍——C++标准库 2.C++各大有名库的介 ...
- [原]Python 简单文件处理
仅仅是为了Linux操作方便= =命令行最近没有时间仔细看看,电脑一直都在机房,暂且这般记着吧= = spath="D:/download/baa.txt" f=open(spat ...
- 《Linux运维趋势》2010-2013年全部期刊下载
<Linux运维趋势>2010.rar <Linux运维趋势>2011_上.rar <Linux运维趋势>2011_下.rar <Linux运维趋势>2 ...