vbscript求和1+2+3+.....N的和

来源:百度知道 编辑:UC知道 时间:2024/06/30 04:26:42
1.用vbscript求和1+2+3+.....N的和
2.编写一个html的页面,在状态栏现实系统当前日期

' 1+2+3+4+5+ ... + n

Dim result, n
n = 3
result = n * (1+n) \ 2
MsgBox result

-----------------------------------------

<!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>无标题文档</title>
</head>

<body>

<script type="text/javascript">
setInterval(function() {
window.status = new Date().toLocaleString();
}, 1000);
</script>

</body>
</html>