(1)在设计程序界面时,应使用图b所示“控件工具箱”中的_____________(填写相应编号)添加文本框Text1。
(2)实现上述功能的VB程序如下,请在划线处填写合适的代码。
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 Then
flag = FalseEnd If
i = i + 2
LoopIf ②_____ Then
Text2.Text = Str(n) + "是素数"
Else
Text2.Text = Str(n) + "不是素数"
End If
End Sub
(3)以下选项中,与加框处表达式“n Mod I = 0”等价的是______________(单选,填字母)。
A.n \ i = Int(n / i) | B.n \ i = n/ i | C.n Mod i = n \ i |
同类型试题
y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2
y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2