当前位置: 移动技术网 > IT编程>脚本编程>VBScript > math.vbs 自然数n的n次方的的和或积的级数

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

2017年12月08日  | 移动技术网IT编程  | 我要评论
复制代码 代码如下:dim n,m n=inputbox("input a number:","recursion") m=factorial ( n ) if n<
复制代码 代码如下:

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

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网