本文共 243 字,大约阅读时间需要 1 分钟。
class Solution { public: int hammingDistance(int x, int y) { int judge = x^y,ret = 0; while(judge) { if((judge & 1)) ret++; judge/=2; } return ret; }};
转载地址:http://xbni.baihongyu.com/