X=X+Y Y=X-Y X=X-Y # I know this solution is not perfect: # when X and Y are big, there is a danger of overflow.