题目:
解答:
class Solution { public: int convertInteger(int A, int B) { int res = 0; int temp = A ^ B; while (temp!=0) { int lowbit = temp & (-temp); res++; temp-=lowbit; } return res; } };
面试题 05.06. 整数转换
原文:https://www.cnblogs.com/ocpc/p/12861170.html