← 返回 apple 的题目列表Swap Two Variables Without Using Temporary Variable
类型:online_judge
apple
Write a function to swap two variables without using a third variable. The input variables can be of any type (primitive or reference). Assume the input is two integers or two objects that support arithmetic operations.
Input: Two variables, e.g., a = 5, b = 10
Output: Swap the values of the two variables, e.g., a = 10, b = 5
Example
Input
5 10