VB问题填空求教!!大部分代码给出,求大神补全!!
vb6.0吧
全部回复
仅看楼主
level 6
题目:要求产生两个包含15个随机两位整数的数列分别存放在两个数组中,而且每个数列中各个数互不相同。删除在两个数列中都出现的那些数并按大小递增输出。
Option Explicit
Dim a(15) As Integer, b(15) As Integer Private Sub shuru(s() As Integer)
Dim i As Integer, j As Integer, x As Integer
Randomize
i = 1
s(1) = Int(Rnd * 90 + 10)
Do While i < UBound(s)
x = Int(Rnd * 90 + 10)
For j = 1 To i
If x = s(j) Then Exit For
Next j
If j > i Then
i = i + 1
s(i) = x
End If
Loop
End Sub
Private Sub sort(s() As Integer) ' 排序
Dim i As Integer, j As Integer, temp As Integer
For i = 1 To UBound(s) - 1
For j = i + 1 To UBound(s)
If s(i) > s(j) Then
temp = s(i)
s(i) = s(j)
s(j) = temp
End If
Next j
Next i
End Sub
Private Sub CmdGen_Click() ' 生成数组并显示
Dim i As Integer
Call shuru(a)
For i = 1 To UBound(a)
Text1.Text = Text1.Text & a(i) & " "
Next i
Call shuru(b)
For i = 1 To UBound(b)
Text2.Text = Text2.Text & b(i) & " "
Next i
End Sub
Private Sub CmdDel_Click() ' 调用排序函数并删除重复元素
?????填空处
End Sub
Private Sub CmdClear_Click()
Text1 = "": Text2 = "": Text3 = "": Text4 = ""
CmdGen.SetFocus
End Sub
Private Sub CmdQuit_Click()
End
End Sub
2013年05月16日 06点05分 1
level 1
所以你会了吗
2017年05月11日 08点05分 2
1