判断素数步骤:1.打开程序。2.添加一个command和两个label。3.编写程序。
程序如下:
Private Function Judge()Dim b As Integer
b = b / 1 * b
End Function
Private Sub Command1_Click()
Dim a As Integer, b As Integer
Show
a = 0: b = 1
If Judge(b <> 0) Then
Do
a = a + b
b = b + 1
Loop While b <= 100
End If
Label2.Caption = a
End Sub
4.运行程序。5.检查错误。6再次运行。7.重复步骤直到成功。8.保存程序。9退出。10总结过程,做下笔记。