文件名称:Classicprograms5
介绍说明--下载内容均来自于网络,请自行研究使用
取一个整数a从右端开始的4~7位。
程序分析:可以这样考虑:
(1)先使a右移4位。
(2)设置一个低4位全为1,其余全为0的数。可用~(~0<<4)
(3)将上面二者进行&运算。-Take an integer a from the right end of the beginning of the 4 to 7. Program analysis: can be considered: (1) first make a right shift 4. (2) set a low 4 bits are all one, all the rest of the number 0. Available ~ (~ 0 < < 4) (3) above, both for & operator.
程序分析:可以这样考虑:
(1)先使a右移4位。
(2)设置一个低4位全为1,其余全为0的数。可用~(~0<<4)
(3)将上面二者进行&运算。-Take an integer a from the right end of the beginning of the 4 to 7. Program analysis: can be considered: (1) first make a right shift 4. (2) set a low 4 bits are all one, all the rest of the number 0. Available ~ (~ 0 < < 4) (3) above, both for & operator.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Classicprograms5.txt