【程序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
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.000920s ]
SELECT `a`.`aid`,`a`.`title`,`a`.`create_time`,`m`.`username` FROM `jrk_downrecords` `a` INNER JOIN `jrk_member` `m` ON `a`.`uid`=`m`.`id` WHERE `a`.`status` = 1 GROUP BY `a`.`aid` ORDER BY `a`.`create_time` DESC LIMIT 10 [ RunTime:0.076808s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.001072s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.001165s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.001064s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.003172s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.000940s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.003667s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.015406s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001185s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 68542 [ RunTime:0.015688s ]