脚本专栏 
首页 > 脚本专栏 > 浏览文章

math.vbs 自然数n的n次方的的和或积的级数

(编辑:jimmy 日期: 2024/10/18 浏览:3 次 )
复制代码 代码如下:
dim n,m
n=inputbox("input a number:","recursion")
m=factorial ( n )
if n<0 then msgbox "must be input a number bigger 0."
elseif n=0 then msgbox "0"&"!"&"is:"&"0"
elseif n>0 then msgbox n&"is:"&m
rem how to done not input and press sure case.
end if
Function Factorial (N)
If N <= 1 Then Factorial = 1
Else Factorial = Factorial(N - 1)*n^n
End If
End Function
上一篇:VBScript 算一算你从出生到现在共计多少天
下一篇:vbscript 调用WebService实现代码