c++
不用加减乘除做加法
http://www.nowcoder.com/questionTerminal/59ac416b4b944300b617d4f7f111b215
class Solution { public: int Add(int num1, int num2) { int result = 0, carry = 0; do { result = num1 ^ num2; carry = (num1 & num2) << 1; num1 = result; num2 = carry; } while(carry != 0); return result; } };