摘要: 19 1 Write a function to swap a number in place without temporary variablesvoid swap(int &a, int &b){ b = a - b; // 4 = 9 - 5 a = a - b; // 5 = 9 - 4 b = a + b; // 9 = 4 + 5 }void swap(int & a, int &b){ a = a^b; b = a^b; a = a^b;}19.3 Write an algorithm which computes the number of t 阅读全文
posted @ 2013-09-11 20:51 冰点猎手 阅读(253) 评论(0) 推荐(0)