您的位置:首页 > Web前端 > HTML

html输出1000内能够被3整除的数

2016-06-30 23:00 288 查看
看看这些代码 多敲多寄

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>范例4-8</title>
</head>

<body>

<script language="javascript">
<!--
for( i = 1; i<1000; i++ )               // 找出0到1000中3的公倍数
{
if( i%3 == 0 )                      // 当模3为0时即是3位数
{
document.write( i + " " );      // 输出
}
}
-->
</script></body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html script