Sub add2(a() As Double, m As Long, n As Long, b() As Double)
'求a(m)~a(n)中任意两个数的和
'b()为两个数的和
Dim k As Long
Dim i As Long
Dim k1 As Long
k1 = UBound(a)
ReDim b((1 + n - m) * (n - m) / 2 - 1) '重新分配空间
Do
For i = m + 1 To n
b(k) = a(m) + a(i)
k = k + 1
Print a(m) & "+" & a(i) & "=" & b(k - 1),
Next
m = m + 1
Loop Until m = n
End Sub