标签:div 运算 solution tle 剑指offer 个数 nbsp int title
class Solution { /* a+b = 进位值 + 不进位的和 */ public: int Add(int num1, int num2) { int n1 ; int n2 ; while(num2!=0){ n1 = num1 ; n2 = num2 ; num1 = n1^n2; num2 = (n1&n2)<<1 ; } return num1 ; } };
标签:div 运算 solution tle 剑指offer 个数 nbsp int title
原文地址:https://www.cnblogs.com/Stephen-Jixing/p/13137583.html