function write(string){
document.write(string+"<br>")
}
write("最大值:"+Math.max(1,4,5,2,6))
write("最小值:"+Math.min(1,4,5,2,6))
function randomcode(length){
var str="123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var code=""
for(var i=0;i<length;++i){
var randomNumber=Math.floor(Math.random()*str.length)
code=code+str.charAt(randomNumber)
}
return code
}
write(randomcode(5))
function prgb(){
var red=Math.floor(Math.random()*256)
var green=Math.floor(Math.random()*256)
var blue=Math.floor(Math.random()*256)
write("("+red+","+green+","+blue+")")
}
prgb()
console