#include <iostream>
using namespace std;
int Grial(int x,int y)
{
int count
= 0;
while(x!=0 || y!=0)
{
if( ((x&0x1) ^ (y&0x1)) )
count++;
x>>=1;
y>>=1;
}
return count;
}
int main()
{
cout<<Grial(2,15)<<endl;
return 0;
}
最后
以上就是悦耳荔枝最近收集整理的关于C++求2进制01不同的位数的全部内容,更多相关C++求2进制01不同内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复