a = 4
b = 5
#第1种
c = 0
c = a
a = b
b = c
#第2种
a = a+b
b = a-b
a = a-b
#第3种
a,b = b,a
print("a=%d,b=%d"%(a,b))
原文地址:https://www.cnblogs.com/xhcdream/p/8159349.html
时间: 2024-11-06 15:45:48
a = 4
b = 5
#第1种
c = 0
c = a
a = b
b = c
#第2种
a = a+b
b = a-b
a = a-b
#第3种
a,b = b,a
print("a=%d,b=%d"%(a,b))
原文地址:https://www.cnblogs.com/xhcdream/p/8159349.html