乐趣区

关于位运算:剑指-Offer-65-不用加减乘除做加法

class Solution {public int add(int a, int b) {while(b!=0) {int c = (a & b)<<1;
            int n = a ^ b;
            a = n;
            b = c;
        }
        return a;
    }
}
退出移动版