标签:
#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; }
标签:
原文地址:http://blog.csdn.net/liuhuiyan_2014/article/details/45418073