<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script>
var res=window.prompt("请输入");
var count=0;
do{ //与while的区别就是无论是否符合判断条件 都执行了一次
res=parseInt(res)+2;
count++;
if(res>10){
document.write(count);
}
}
while(res<10)
</script>
</body>
</html>
js小例子(4)do while实现(3)
最新推荐文章于 2022-12-21 11:35:58 发布