2005年5月14日
摘要: 模拟n道单选题的所有可能情况。假设有3道单选题,每个单选题有4个选项,如果方便的模拟出所有的答案。我是这样写的算法。做一次循环所有情况共有:3*4^2+3*4+3=63for (int i=0;i<=63;i++){ //将i转换成4进制数 checki=IntChange("04",i);//不足3位的,如(13、22等),前面补零 len=checki.length; for (k... 阅读全文
posted @ 2005-05-14 22:16 Seraph 阅读(525) 评论(0) 推荐(0) 编辑
摘要: function mod(div,base) { return Math.round(div - (Math.floor(div/base)*base));}function IntChange(cs_lx,cs_int){ result=''; v_chr='0123456789ABCDEF'; v_ix=cs_lx/1; if (!((v_ix>16)||(v_ix0) { i= mod... 阅读全文
posted @ 2005-05-14 22:10 Seraph 阅读(649) 评论(0) 推荐(0) 编辑