题目:将一个4字节整数的二进制表示中的001替换为011
答:
int replace(int num){ unsigned int mode3bit = 7; unsigned int mode1bit = 1; int shift = 0; int result = 0; while (shift < 32) { while (shift < 32 && (num & (mode3bit<= 32) { break; } else if (32 - shift < 3) //高位不足3位 { result += (num & (mode3bit<