用VB求阶乘和
答案:4 悬赏:0 手机版
解决时间 2021-04-06 22:26
- 提问者网友:了了无期
- 2021-04-06 00:07
用VB求阶乘和
最佳答案
- 五星知识达人网友:你哪知我潦倒为你
- 2021-04-06 01:29
Private Sub Command1_Click()
For i = 1 To 10
Sum = Sum + jiecheng(i)
Next
Print Sum
End Sub
Function jiecheng(num)
jiecheng = 1
For i = 1 To num
jiecheng = jiecheng * i
Next
End Function
For i = 1 To 10
Sum = Sum + jiecheng(i)
Next
Print Sum
End Sub
Function jiecheng(num)
jiecheng = 1
For i = 1 To num
jiecheng = jiecheng * i
Next
End Function
全部回答
- 1楼网友:不甚了了
- 2021-04-06 04:41
我也不知道
追问:hehe....上面三个都可以运行出结果的
追问:hehe....上面三个都可以运行出结果的
- 2楼网友:孤独入客枕
- 2021-04-06 03:14
Private Sub Command1_Click()
For i = 1 To 10
aa = aa + JiCheng(i)
Next
Print aa
End Sub
Private Function JiCheng(ByVal Int_A As Integer) As Long
JiCheng = 1
For i = 1 To Int_A
JiCheng = JiCheng * i
Next i
End Function
For i = 1 To 10
aa = aa + JiCheng(i)
Next
Print aa
End Sub
Private Function JiCheng(ByVal Int_A As Integer) As Long
JiCheng = 1
For i = 1 To Int_A
JiCheng = JiCheng * i
Next i
End Function
- 3楼网友:長槍戰八方
- 2021-04-06 02:31
Public Function f(m As Integer) As Long
Dim i As Integer, s As Long
s = 1
For i = 1 To m
s = s * i
Next i
f = s
End Function
Private Sub Command1_Click()
Dim i As Integer, s As Long
s = 0
For i = 1 To 10
s = s + f(i)
Next
Print s
End Sub
Dim i As Integer, s As Long
s = 1
For i = 1 To m
s = s * i
Next i
f = s
End Function
Private Sub Command1_Click()
Dim i As Integer, s As Long
s = 0
For i = 1 To 10
s = s + f(i)
Next
Print s
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯