2013年12月16日
摘要: 原题链接异或的经典应用异或运算法则 1. a ^ b = b ^ a2. a ^ b ^ c = a ^ (b ^ c) = (a ^ b) ^ c;3. d = a ^ b ^ c 则 a = d ^ b ^ c.4. a ^ b ^ a = b 附ac代码:#include int main(){ int t, a, b; while(scanf("%d", &t), t){ a = 0; while(t-- && scanf("%d", &b)) a ^= b; printf("%d\n", a) 阅读全文
posted @ 2013-12-16 13:00 长木Qiu 阅读(141) 评论(0) 推荐(0) 编辑