无中间变量交接两变量值
无中间变量交接两变量值
class Solution:
def jiaohuan(self, a, b):
a = a ^ b
b = a ^ b
a = a ^ b
return a, b
if __name__ == "__main__":
s = Solution()
a = 3
b = 107
t = s.jiaohuan(a, b)
for i in range(len(t)):
print(t[i], end=" ")
作者:楚千羽
出处:https://www.cnblogs.com/chuqianyu/
本文来自博客园,本文作者:楚千羽,转载请注明原文链接:https://www.cnblogs.com/chuqianyu/p/16247771.html
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利!