So now the result of X-Y is the previous x, and then copied to y, written as Y=X-Y,
Now y is the original x, and that x is still the sum of that X+Y, right?
X-Y is now this X, which is quite understandable.
Another method is to declare an empty variable, which is equivalent to changing water for two bottles. You need an empty bottle.
int a = 0;
a = x; Give X to A, and then the bottle of X will be empty.
x = y; Then give y to x, is y also empty? Does x contain y water?
y = a; Then give Y an A. Now there is water in Y? It belongs to X.
They just exchanged. famous