2013年10月27日

异或运算的简单应用

摘要: 问题1:不使用临时变量,实现两个整型变量 x, y 值的交换。以下为 C++ 实现代码: 1 /************************************************************** 2 author : 林秋伟 3 time : 2013-10-27 4 **************************************************************/ 5 #include 6 using namespace std; 7 8 void swap(int &x, int &y){ 9 x^=y; y^=x; x 阅读全文

posted @ 2013-10-27 22:43 林秋伟 阅读(164) 评论(0) 推荐(0)

导航