VB程序题(高手速度来)
答案:1 悬赏:30 手机版
解决时间 2021-04-16 08:32
- 提问者网友:未信
- 2021-04-15 10:36
求(3,500)内的所有素数和 并输出结果
最佳答案
- 五星知识达人网友:洒脱疯子
- 2021-04-15 12:08
Function sumSushu(ByVal a As Integer, ByVal b As Integer) As Long
Dim i As Integer
sumSushu = 0
For i = a To b
If sushu(i) = 1 Then
sumSushu = sumSushu + i
End If
Next
End Function
Function sushu(ByVal a As Integer) As Integer
Dim b As Integer
sushu = 0
For b = 2 To Sqr(a)
If a Mod b = 0 Then
Exit Function
End If
Next
sushu = 1
End Function
Private Sub Form_Load()
MsgBox sumSushu(1, 5)
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯