首页 » 编程之美 » 正文 [leetcode]Number Complement 2020/03/09 | 编程之美 | hujiulin | 暂无评论 | 51 views class Solution { public: int findComplement(int num) { int countDigit = 0; int numBak = num; while(0 < num) { num = num >> 1; countDigit++; } return (int)(pow(2, countDigit) - 1 - numBak);<br /> } };