4-9作业批改
来源:4-9 编程练习
_louis_5
2018-08-06 13:33:15
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Math.random()</title>
</head>
<body>
<script>
//补充代码
var num=Math.floor(Math.random()*9+1);
do{var NUM=prompt("请输入你猜的数字");
if(num>NUM){
alert("你猜的数字小了");
}else if(num<NUM){
alert("你猜的数字大了");
}else{
alert("恭喜你猜对了");
break;
}
}while(num!==NUM);
</script>
</body>
</html>
1回答
妮可妮可妮_
2018-08-06
效果可以实现,继续加油~