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配置文 ...
随机推荐
- Sharding-jdbc视频:当Sharding-jdbc遇到Spring Boot
一.什么是Sharding-jdbc? 在介绍Sharding-JDBC之前,我们需要先说明下Sharding-Sphere. Sharding-Sphere是一套开源的分布式数据库中间件解决方案组成 ...
- C 语言 计算
note1: 不要把表达式写的太复杂,不容易阅读和理解,容易造成读程序的误解,所以要避免写出复杂的表达式. note2:程序是按步执行的,程序表达的是顺序执行的动作,而不是关系.
- 使用keil5,加断点调试后,停止运行的问题
加上断点调试,执行到断点的时就出现程序停止运行的提示. 原因:是工程路径存放太深.
- [DOM]初识DOM
文档对象模型(Document Object Model,简称DOM),是W3C组织推荐的处理可扩展标志语言的标准编程接口.在网页上,组织页面(或文档)的对象被组织在一个树形结构中,用来表示文档中对象 ...
- 如何才能成为一个合格的web前端工程师
转载原文地址:https://juejin.im/post/5cc1da82f265da036023b628 开篇前端开发是一个非常特殊的行业,它的历史实际上不是很长,但是知识之繁杂,技术迭代速度之快 ...
- 什么是P2P流标
1.被动流标:在规定的投标时间内,一般是7天,没有凑齐这笔借款,就流标了: 2.主动流标:借款人或平台原因,将为投满的标下架,做流标处理 介绍: 对于投资者来说,在投资P2P理财的时候,可能会遇到过流 ...
- HBASE分布式集群搭建(ubuntu 16.04)
1.hbase是依赖Hadoop运行的,因此先确保自己已搭建好Hadoop集群环境 没安装的可以参考这里:https://www.cnblogs.com/chaofan-/p/9740408.html ...
- Mybatis级联:关联、集合和鉴别器的使用
Mybatis中级联有关联(association).集合(collection).鉴别器(discriminator)三种.其中,association对应一对一关系.collection对应一对多 ...
- BitmapData.threshold()方法
import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import fl ...
- 【转】BFG Repo-Cleaner: Removes large or troublesome blobs like git-filter-branch does, but faster.
https://rtyley.github.io/bfg-repo-cleaner/ an alternative to git-filter-branch The BFG is a simpler, ...