如下程序是从键盘上输入一个正整数,找出大等于该数的第一个素数。 Private Sub Command1_Click() Dim i As Integer, x As Integer, y As Integer, flag As Boolean flag = False x = InputBox(" 请输入一个正整数 ", " 输入正整数 ") y = x Do While Not flag i = 2 flag = (1 ) Do While flag And i <= x / 2 If x Mod i = 0 Then flag = False Else (2 ) End If Loop If Not flag Then ( 3 ) Loop Print " 大等于 " & Str(y) & " 的第一个素数是: " & Str(x) End Sub