int Add(int num1, int num2) {
return (num1 | num2) + (num1 & num2);
}
return (num1 | num2) + (num1 & num2);
}
//num1 | num2,结果为两个数字非0二进制位的和
//num1 & num2,结果为双方都为1时的没有计算的二进制位的和
//eg: 3:00000011
// 5:00000101
// 3 | 5 : 00000111 = 7
//3 & 5: 00000001 = 1
//3 + 5 = 7 + 1 = 8