求解这道vb编程!
答案:1 悬赏:0 手机版
解决时间 2021-04-26 20:30
- 提问者网友:
- 2021-04-25 22:06
求解这道vb编程!
最佳答案
- 五星知识达人网友:夜风逐马
- 2021-04-25 23:33
判断一个数字是否为素数的函数
Public Function IsSushu(ByVal pa As Integer) As Boolean
Dim pb As Integer = pa - 1
Dim res As Boolean = True
For i = 2 To pb
If pa Mod i = 0 Then
res = False
Exit For
End If
Next i
Return res
End Function
Public Function IsSushu(ByVal pa As Integer) As Boolean
Dim pb As Integer = pa - 1
Dim res As Boolean = True
For i = 2 To pb
If pa Mod i = 0 Then
res = False
Exit For
End If
Next i
Return res
End Function
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯