⒋ 试用VBScript编程,实现计算并输出1到10的阶乘之和。
来源:百度知道 编辑:UC知道 时间:2024/05/25 19:17:16
dim s
dim i
dim sum
i = 0
s = 1
do while(i<10)
i=i+1
s = s * i
sum = sum + s
loop
msgbox sum
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>VBSCript</title>
</head>
<body>
<script language=vbscript >
dim a,b,ab
b = 0
a = 1
do while(b<10)
b=b+1
a = a * b
ab = ab + a
loop
msgbox ab
</script>
</body>
</html>