C++简洁代码(一行):
class Solution { public: int Add(int num1, int num2) { return num2 == 0 ? num1 : Add((num1 ^ num2),(unsigned int)(num1 & num2) << 1); } };
C++简洁代码(一行):
class Solution { public: int Add(int num1, int num2) { return num2 == 0 ? num1 : Add((num1 ^ num2),(unsigned int)(num1 & num2) << 1); } };