资 源 简 介
【程序54】
题目:取一个整数a从右端开始的4~7位。
程序分析:可以这样考虑:
(1)先使a右移4位。
(2)设置一个低4位全为1,其余全为0的数。可用~(~0<<4)
(3)将上面二者进行&运算。
-[54] procedures Topic: get an integer a from the right end of the beginning of the 4 ~ 7. Process analysis: It can be considered: (1) first so that a shifted to right 4. (2) to set up a low four-wide for one, the rest of the number of 0. Available ~ (~ 0