0710编程之美二进制扩展问题

来源:互联网 发布:淘宝上比较好的男鞋店 编辑:程序博客网 时间:2024/06/05 19:53
#include<iostream>
using namespace std;
int main()
{
int a, b;
while (cin >> a >> b)
{
int count = 0;
int c = a^b;
while (c)
{
c &= c - 1;
count++;
}
cout << count << endl;
}
cin.get();
return 0;
}
原创粉丝点击