void swap(char& a,char& b){ a=a^b; b=b^a; a=a^b; }
主要原理是: a^a=0。字符串反转算法的优化可以利用该字符交换方法。
posted on 2013-10-16 18:32 _foolish 阅读(216) 评论(0) 编辑 收藏 举报