求VB素数?

来源:百度知道 编辑:UC知道 时间:2024/05/27 23:45:15
求2-10000中能用2的次方减1表示的素数

运行结果为:3,7,31,127,8191
代码如下:
form1.frm
-------------------------------------------------
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 720
TabIndex = 1
Top = 1440
Width = 1455
End
Begin VB.TextBox Text1
Height = 495
Left = 720
TabIndex = 0
Top = 360
Width = 3495
End
End
Attribute