题型:综合题 题类:常考题 难易度:普通
浙江省台州市书生中学2018-2019学年高二上学期信息技术第一次月考试卷
图1
图2
Private Sub Command1_Click()
Dim n As Integer, i As Integer
Dim flag As Boolean ‘用于标记是否为素数
Randomize
n = Int( )*2+1 ‘随机生成三位正奇数
Text1.Text = Str(n)
flag = True ‘标记为素数
i = 3
Do While i <= n - 1 And flag = True
If n Mod i = 0
i = i + 2
Loop
If flag=true Then
Text2.Text = Str(n) + “是素数”
Else
Text2.Text = Str(n) + “不是素数”
End If
End Sub
A.n \ i = Int(n / i) B.n \ i = n/ i C.n Mod i = n \ i
试题篮