嵌入式软件工程师&&太极拳
全部博文(548)
分类:
2011-02-20 20:12:56
#includeint main(void) { int i, j, num, bit ,length; printf("please input num: "); scanf("%d", &num); printf("please input bit: "); scanf("%d", &bit); printf("please input length: "); scanf("%d", &length); i = (((1 << length) - 1) << (bit -length + 1)) ^ num ; printf("The bit is: %x \n", i); return 0; }