题目一:
There are two int variables: a and b, don’t use “if”, “? :”, “switch” or other judgement statements, find out the biggest one of the two numbers.
这个好像是朗讯的题目
解析 :这个其实是个简单的数学题目(int)(( (a+b)+abs(a-b))/2)
题目二:
有两个变量a,b,不允许用第三块存储空间,交换a、b的值
解析 :这个问题其实是问题一的一个变种。
step 1: a+b -> a
step 2: a-b -> b
step 3: a-b -> a