需求分析
(1) 任何一个表达式都是由操作数、运算符和界限符组成的,我们称之为单词.
(2) 表达式求值首先要符合四则运算规则:
① 先乘除,后加减
② 从左到右进行运算
③ 先括号内,后括号外
(3) 功能实现:
① 若当前单词为数字串,则压入数值栈
② 若当前单词为运算符并大于运算栈的栈顶符号,则进栈
③ 若当前单词为运算符并等于运算栈的栈顶符号,去括号,输出
④ 若当前单词为运算符并小于运算栈的栈顶符号,则进行运算
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.001763s ]
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.118372s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.001073s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.004068s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.001171s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.004972s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.000917s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.003933s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.015918s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001294s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 497750 [ RunTime:0.019007s ]