How to swap two numbers without using temp variables or arithmetic operations?

后端 未结 10 1003
Happy的楠姐
Happy的楠姐 2020-12-13 00:09

This equation swaps two numbers without a temporary variable, but uses arithmetic operations:

a = (a+b) - (b=a);

How can I do it without ar

10条回答
提交回复
热议问题