function writeDocument(variable) {
document.write(variable + "<br/>");
}
writeDocument("最大值最小值--------------");
writeDocument("最大值:"+Math.max(1,3,9,10,18,99));
writeDocument("最小值:"+Math.min(1,3,9,10,18,99));
writeDocument("生成随机验证码--------------");
function gcode(length){
var str="01234789ABCDEFG";
var code="";
for(var i=0;i<length;i++)
{
var randomNum=Math.floor(Math.random()*str.length);
code=code + str.charAt(randomNum) ;
}
return code;
}
writeDocument(gcode(4));
writeDocument(gcode(5));
writeDocument(gcode(6));
writeDocument("生成随机的颜色 rgb(255,255,255)--------------");
function gcolor()
{
var r= Math.floor(Math.random()*256);
var g= Math.floor(Math.random()*256);
var b= Math.floor(Math.random()*256);
writeDocument("rgb("+r+","+g+","+b+")");
}
gcolor();
console