
Leetcode
wbing_520
这个作者很懒,什么都没留下…
展开
-
Leetcode 371. Sum of Two Integers
public class Solution { public int GetSum(int a, int b) { if(a == 0) return b; if(b == 0) return a; int sum = 0; while(b != 0){ sum = a ^ ...原创 2019-02-03 02:33:56 · 120 阅读 · 0 评论 -
Bit operators "+ - * /"
1 Byte = 8 bit 1 bit is 1 or 0. Add /* ** ** */ int Add(int a, int b){ if(b == 0) return a; int sum = a ^ b; // Get the addition without carry int carry = (a & b) << 1; //Get the...转载 2019-02-18 08:11:59 · 173 阅读 · 0 评论