//term1和term2是题目给的两个BYTE
byte x = (byte)(term1 ^ term2);
int total = 0;
while(x != 0){
x = (byte) (x & (x - 1));
total++;
}
if(total == 1) return 1; else return 0;
[Amazon]Given 2 numbers. Find if they are consecutive gray (grey) code sequences
最新推荐文章于 2016-11-27 17:23:01 发布