根据二进制格雷码转换成自然二进制码的法则,可以得到以下的三种代码方式: staticunsignedint GraytoDecimal(unsignedint x) { unsignedint y = x; while(x>>=1) y ^= x; return y; } staticunsignedint GraytoDecimal(unsignedint x) { x^=x>>16; x^=x>>8; x^=x>>4; x^=X>>2; x^=x^1; return x; } staticunsignedint GraytoDecimal(unsignedint x) { int i; for(i=0;(1