<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript" type="text/javascript">
//随机一个0-20的整数
var num=parseInt(20*Math.random());for(var i=1;i<6;i++){
if(i<5){
//在弹出框输入数字
var shu=prompt("请输入一个数","");if(num>shu){
document.write("您输入的数小了第"+i+"次");
}else if(num<shu){
document.write("您输入的数大了第"+i+"次");
}else{
document.write("您终于对了第"+i+"次");
break;
}
}else{
alert("笨蛋了吧,准确的数字是"+num);
}
}
</script>
<body>
</body>
</html>
4765



被折叠的 条评论
为什么被折叠?



