通过做一些可以被称为交叉xoring的东西,与运营商^ = 我把它留作练习,因为它很有趣:-) (不要担心tmp:记住自动变量可以存在于寄存器中) Walter TrossBy doing something which could be called cross-xoring, with operator ^=I leave it as an exercise, since it is fun :-)(Don''t worry about the tmp: remember that auto variables can live inregisters)Walter Tross 或者可以使用定期加法和结构: b = a + b; a = b - a; b = b - a; - Maxim YegorushkinOr one can use regular addition and substruction:b = a + b;a = b - a;b = b - a;--Maxim Yegorushkin 这篇关于不使用tmp变量交换两个整数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 06:19