Option Base 1
Private Sub Form_Click() Dim a(), b(), c(), k As Integer, m As Integer, n As Integer m = InputBox("请输入A数组长度", "数据入") m = Val(m) n = InputBox("请输入B数组长度", "数据入") n = Val(n) ReDim a(m) ReDim b(n) k = m + n ReDim c(k) For i = 1 To m a(i) = InputBox("请输入第" & i & "个元素", "A数组元素输入") a(i) = Val(a(i)) Next i For j = 1 To n b(j) = InputBox("请输入第" & j & "个元素", "B数组元素输入") b(j) = Val(b(j)) Next j For i = 1 To m c(i) = a(i) Next i For i = 1 To n c(m + i) = b(i) Next i For i = 1 To k Print Tab(5 * i); c(i); Next i For i = 1 To k For j = 1 To k - 1 If c(j) > c(i) Then t = c(i) c(i) = c(j) c(j) = t End If Next j Next i For i = 1 To k Print Tab(5 * i); c(i); Next i End Sub