建一个Command1。中间那部分就是运算程序。
代码如下。
=============
Private
Sub
Command1_Click()
Dim
a
As
Integer,
i
As
Integer,
s
As
Double
s
=
1
a
=
InputBox("输入数")
For
i
=
2
To
a
s
=
s
*
i
Next
MsgBox
a
&
"的阶乘是:"
&
s
End
Sub
标签:阶乘,VB
版权声明:文章由 知识百答 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.zhshbaida.com/answer/169648.html