原题链接:Leetcode 371. 两整数之和
参考题解:Leetcode 371. 两整数之和
class Solution {
public:
int getSum(int a, int b) {
while(b)
{
unsigned int carry=(unsigned int)(a&b)<<1;
a=a^b;
b=carry;
}
return a;
}
};