b是a的子集,现想求b的补集,即 c = (1,3,5)该用什么算法??作者: bagwell333 时间: 2008-4-1 14:29
hi, LZ,俺不是学数学的,vbscript也不熟悉。
这样可以?
a = Array(1, 2, 3, 4, 5)
b = Array(2, 4)
Dim b_isIn
b_isIn = False
For j = 0 To UBound(a)
For i = 0 To UBound(b)
If a(j) = b(i) Then
b_isIn = True
Exit For
End If
Next
If b_isIn = False Then
MsgBox (a(j) & " is a result")
Else
b_isIn = False
End If
Next