输入例子:
1999 2299
1999 2299
输出例子:7
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
#include<windows.h>
int main()
{
int i = 0;
int m = 0;
int n = 0;
int count = 0;
printf("请输入两个数:\n");
scanf("%d%d", &m, &n);
for (i = 0; i < 32; i++)
{
if ((m & 1) != (n & 1))
{
count++;
}
m = m >> 1;
n = n >> 1;
}
printf("count=%d", count);
system("pause");
return 0;
}