//编写函数,将一个数的指定位置置0或置1 #include <stdio.h> unsigned int set_bit(unsigned int num, int pos, int flag) { int n = 1; n = n << (pos - 1); //将n的第pos位置1,其它全为0 if (flag == 0) { num = num&(~n); } else if (flag == 1) { num = num | n; } else printf(&q
'添加option到指定位置(按value排序) dim valindex valindex=-1 for i=0 to selcom.length-1 if selcom.Options(i).value >selallcomoption.value then valindex=i exit for end if next dim oOption set oOption= document.CreateElement("OPTION") oOption.text = selal
javascript两行代码按指定格式输出日期时间,具体看代码: function date2str(x,y) { var z ={y:x.getFullYear(),M:x.getMonth()+1,d:x.getDate(),h:x.getHours(),m:x.getMinutes(),s:x.getSeconds()}; return y.replace(/(y+|M+|d+|h+|m+|s+)/g,function(v) {return ((v.length>1?"0"