推选一名办公室主任。假设有10名候选人准备参与竞选。希望编写一个程序,输入一组选举人的投票信息,统计每
个候选人的得票数目及选举结果。
-Selection of a Director of the Office. Assumptions have 10 candidates ready to participate in the election. Hope that the preparation of a program, enter a group of electors voting information, statistics the number of votes each candidate and the election results.
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.001983s ]
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.086613s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.001948s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.002156s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.002244s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.003952s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.002156s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.003324s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.014594s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.002471s ]
UPDATE `jrk_articles` SET `hits` = 1 WHERE `id` = 152926 [ RunTime:0.001183s ]