mac idea 窗口最大化:vb求100以内的素数的个数
来源:百度文库 编辑:高校问答 时间:2024/05/01 10:14:30
麻烦写的详细点行吗
最好是把代码写出来
最好是把代码写出来
有25个。
Dim s_Count,i
s_Count=0 '素数个数
For i=2 To 100
s_Count=s_Count+isSushu(i)
Next
MsgBox s_Count
Function isSushu(num) '判断是否素数,是返回1,否返回0
Dim II
For II=2 To Num\2
If (Num Mod II)=0 Then
isSushu=0
Exit Function
End If
Next
isSushu=1
End Function