371. Sum of Two Integers Description: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Difficulty:Easy 方法:位操作 class Solution { public: int getSum(int a, int b) { int res = a; while(b!=0){ res = a ^ b; b = (a & b) << 1; a = res; } return res; } };