#include <stdio.h> int Func(int m, int n) { int tmp = m^n; int count = 0; /* 统计二进制中1的个数, 1的个数即为二进制位不同 */ while(tmp != 0) { tmp = tmp & (tmp-1); count++; } return count; } int main() { int m, n; while (scanf("%d %d", &m, &n) != EOF) { // 注意 while 处理多个 case // 64 位输出请用 printf("%lld") to int ret = Func(m, n); printf("%d", ret); } return 0; }