标签:and its clu names nbsp code 个数 统计 font




#include<bits/stdc++.h>
using namespace std;
int getbits(int n)//统计(n)bin中的1的个数
{
int res=0;
while(n)
{
res++;
n=n&(n-1);
}
return res;
}
int cmp(int a,int b)//统计a,b中the number of different bits in the binary format of a and b.
{
return getbits(a^b);
}
int main()
{
int a,b;
while(cin>>a>>b) cout<<cmp(a,b)<<endl;
return 0;
}
标签:and its clu names nbsp code 个数 统计 font
原文地址:https://www.cnblogs.com/dragondragon/p/11340440.html