zoj3432 Find the Lost Sock 亦或的运用
Alice bought a lot of pairs of socks yesterday. But when she went home, she found that she has lost one of them. Each sock has a name which contains exactly 7 charaters.
Alice wants to know which sock she has lost. Maybe you can help her.
Input
There are multiple cases. The first line containing an integer n (1 <= n <= 1000000) indicates that Alice bought n pairs of socks. For the following 2*n-1 lines, each line is a string with 7 charaters indicating the name of the socks that Alice took back.
Output
The name of the lost sock.
Sample Input
2
aabcdef
bzyxwvu
bzyxwvu
4
aqwerty
eas fgh
aqwerty
easdfgh
easdfgh
aqwerty
aqwerty
2
0x0abcd
0ABCDEF
0x0abcd
Sample Output
aabcdef
eas fgh
0ABCDEF
题意:
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cstring>
#include<memory.h>
using namespace std;
char s[],c;
int main()
{
int n;
while(~scanf("%d\n",&n)){
for(int i=;i<=;i++) s[i]='\0';
for(int i=;i<*n;i++){
for(int j=;j<;j++){
c=getchar();
s[j]=s[j]^c;
}
}
printf("%s",s);
}
return ;
}
zoj3432 Find the Lost Sock 亦或的运用的更多相关文章
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
有时候,当我们使用"mysql"."mysqladmin"."mysqldump"等命令管理数据库时,服务器抛出类似如下错误: 一.错误现场 ...
- XtraBackup出现 Can't connect to local MySQL server through socket '/tmp/mysql.sock'
Xtrabackup做备份时遇到下面错误信息MySQL server: Can't connect to local MySQL server through socket '/tmp/mysql.s ...
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
从供应商手中接手一个云平台(Windwos Azure)上的MySQL数据库,登录数据库时遇到错误: $mysql -uroot -p Enter password: ERROR 2002 (HY00 ...
- 启动mysql时显示:/tmp/mysql.sock 不存在的解决方法
启动mysql时显示:/tmp/mysql.sock 不存在的解决方法 启动mysql时报错的解决(mysql 5.0.45 redhat as 43) ====================== ...
- 找不到mysql.sock,mysql.sock丢失问题解决方法
Can 't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock '(2) "; 是你的mysql ...
- Mac mySql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的解决办法
我的环境:Mac 10.11.6 ,mysql 5.7.14 . mac mySql 报错ERROR 2002 (HY000): Can't connect to local MySQL serv ...
- Can't connect to local MySQL server through socket '/tmp/mysql.sock'
找不到/tmp/mysql.sock这个文件,需要查找/tmp/mysql.sock文件位置,并在/etc/my.cnf里面配置 [client]socket=/var/lib/mysql/mysql ...
- Mac OS 下 mysql 找不到 mysql.sock 的问题
mysql.sock 无法找到一般存在两种问题,一是mysql服务未启动,mysql.sock没有生成,二是mysql.sock的指向位置出错,在指向位置加个mysql.sock的软链接就可以解决. ...
- W.Richard Stevens sock program
在<TCP/IP卷一>中有一个程序sock,Stevens的主页上有,但是在LINUX下通常无法工作(那时还没有LINUX),经过百度,发现http://www.icir.org/chri ...
随机推荐
- 制作Visual Studio 2017 (VS 2017) 离线安装包
史上功能最强大的Visual Studio 2017版本发布,但是由于版本更新速度加快和与第三方工具包集成的原因,微软研发团队没有为这个版本提供离线下载的安装文件.如果用户处在一个与外网隔离的网络环境 ...
- Java线程调度—休眠
线程休眠的方法是Thread.sleep(long millis) 和Thread.sleep(long millis, int nanos) ,均为静态方法,那调用sleep休眠的哪个线程呢?简单说 ...
- JS查错小工具-三生有幸【推荐】
H5和CSS语言在开发者官网上都有在线查错工具,同样的,更加复杂的JavaScript也需要一个查错工具,(别指望DreamWeaver了,debug功能做的太垃圾,还不如Firefox自带的强..) ...
- 九度OJ 1014 排名
#include <iostream> #include <string.h> #include <sstream> #include <math.h> ...
- Brotli、Deflate、Zopfli、LZMA、LZHAM、Bzip2六种无损数据压缩性能比较
这里比较了六种数据压缩算法,结果表明Brotli算法会代替普遍使用的Deflate算法.分别用Canterbury compression corpus,web contentcorpus,和 enw ...
- 团队作业1 团队展示&选题
团队展示&选题 Coding项目地址:https://git.coding.net/wjunren/running.git 一.团队展示 1.队名:Runing Guys 2.队员: 组长:骆 ...
- 201521123083《Java程序设计》第12周学习总结
1. 本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结多流与文件相关内容. 2. 书面作业 将Student对象(属性:int id, String name,int age,doubl ...
- 团队作业8——第二次项目冲刺(Beta阶段)Day6——5.25
1.提供当天会议照片: 2.会议的内容: (1)讨论已经完成的功能,讨论存在的问题 (2)对于界面,谈谈各自的看法 (3)讨论接下来的任务和改进的地方 3.工作安排: 队员 今日任务 明日任务 贡献比 ...
- 第1周-java作业总结与建议
1. 本周作业简评与建议 存在的问题: 这周的作业普遍存在一个格式混乱的问题.请认真学习Markdown,我们后面的作业都要使用Markdown.Markdown学习请参考http://group.c ...
- 201521123038 《Java程序设计》 第十一周学习总结
201521123038 <Java程序设计> 第十一周学习总结 1. 本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结多线程相关内容. 2. 书面作业 本次PTA作业题集多 ...