
(1)如图所示,该VB程序的窗体中共有 类对象(填数字)。
(2)实现上述功能的VB程序如下,请在划线处填入合适的代码。
(3)程序中加框处代码有错,请改正。
Const n = 10
Dim d(n) As Integer, c As Integer
Private Sub Form_Load()
Dim i As Integer, j As Integer, f As Boolean, s As String
Randomize
c = n
For i = 1 To n
f = False
d(i) = ① ' 随机生成个位数为“9”的两位数
For j = 1 To i - 1
If ② Then f = True
Next j
If f Then c = c - 1
Next i
'原始数据在文本框Text1中显示。代码略
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer, m As Integer
Dim cnt As Integer,t As String, s As String
d(0) = 100
cnt = Val(Text2.Text)
If cnt > c Then
Text3.Text = "输入筛选的个数太大,请重新输入!"
Exit Sub 'Exit Sub表示退出过程
End If
For i = 1 To cnt
k = i
For j = i + 1 To n
If d(j) < d(i - 1) And()Then k = j
Next j
If k <> i Then
t = d(i): d(i) = d(k): d(k) = t
End If
Next i
For i = 1 To cnt
s = s + Str(d(i)) + ","
Next i
Text3.Text = ③
End Sub

同类型试题

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

