
展开全部
你好!!
<!DOCTYPE html>
<html>
<head>
<script>
window.onload = function(){
//随机生成[0,100)的随机数
var rndNum1 = Math.round(Math.random()*(100-0)),
rndNum2 = Math.round(Math.random()*(100-0));
document.write("生成的两个随机数为:"+rndNum1+","+rndNum2+"<br/>");
document.writeln("其中最大值为:" + Math.max(rndNum1,rndNum2));
};
</script>
</head>
<body>
</body>
</html>
追答
<!DOCTYPE html>
<html>
<head>
<script>
window.onload = function(){
//随机生成[0,100)的随机数
var rndNum1 = Math.random(),
rndNum2 = Math.random();
document.write("X="+rndNum1+"<br/>");
document.write("Y="+rndNum2+"<br/>");
document.writeln("最大值是:" + Math.max(rndNum1,rndNum2));
};
</script>
</head>
<body>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询