7K - find your present (2)
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)的更多相关文章
- 跳转时候提示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配置文 ...
随机推荐
- 关于如何在电脑上安装adb来操作手机(Android)的方法及步骤
1.需要真实的安卓手机: 2.安卓手机需要开启USB调试模式,允许电脑进行调试(各个手机的开启方式可能不同,不知道的自行百度): 3.电脑需要安装ADB驱动,这里提供一个下载地址:https://ad ...
- jquery中对小数进行取整
var uu=Math.floor(5.36) 向下取整 结果为5 var uu=Math.floor(5.88) 结果为5 Math.ceil(5.33) 向上取整,结果为6 Math.round( ...
- Docker镜像仓库Harbor搭建及配置
一.harbor简介 Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器,通过添加一些企业必需的功能特性,例如安全.标识和管理等,扩展了开源Docker Distribut ...
- PHP语言入门的学习方法十要素
对于PHP程序设计语言来说.每个人的学习方式不同,写这篇文章的目的是分享一下自己的学习过程,仅供参考,不要一味的用别人的学习方法,找对自己有用的学习方式.经常在某些论坛和QQ群里看到一些朋友会问“怎样 ...
- core dump 配置
引用:http://www.cnblogs.com/secondtonone1/p/5732938.html Windows环境崩溃问题可根据vs调试工具查看,Linux同样可以查看调用堆栈的信息,只 ...
- 魔力Python——一些基本概念
1.I/O操作 I/O输入/输出(input/output)的缩写. 概念I/O系统,英文全称为“Input output system”,中文全称为“输入输出系统”,由输入输出控制系统和外围设备两部 ...
- P1219 八皇后
题目描述 检查一个如下的6 x 6的跳棋棋盘,有六个棋子被放置在棋盘上,使得每行.每列有且只有一个,每条对角线(包括两条主对角线的所有平行线)上至多有一个棋子. 上面的布局可以用序列2 4 6 1 3 ...
- gridcontrol 根据某一列数据来控制其他列合并
首先需要属性栏中设置这一列可以合并,再在CellMerge方法中写 private void gridView1_CellMerge(object sender, DevExpress.XtraGri ...
- [Flutter] 因为不讲这个重点, 全网所有 flutter 实战视频沦为二流课程
二流课程也有其存在的价值,看到不同组件的轮流使用也是不断熟悉的过程,不过太眼花缭乱了. 授人以渔,基础用法是其一,讲清套路是其二,不然坑萌新. 那么 flutter 的套路是什么呢,我认为有下面几点: ...
- JavaScript遍历集合(for...of/for...in/forEach)
var arr = [1,2,3]; var map = new Map(); map.set('baylor',22); var s = new Set(); s.add([1,2,3]); for ...