Private Sub Command1_Click()
Dim s1 As String, s2 As String, s3 As String
Dim r1 As String, r2 As String
Dim i As Long, a As String
s1 = Text1.Text
s2 = Text2.Text
s3 = Text3.Text
For i = 1 To Len(s1)
a = Mid(s1, i, 1)
If InStr(1, s2, a) Then
r1 = r1 & a
End If
Next
r2 = s1
For i = 1 To Len(s3)
a = Mid(s3, i, 1)
r2 = Replace(r2, a, "")
Next
Text4 = r1
Text5 = r2
End Sub
只能输入单数,那你怎么输入 两位以上的数呀
至于交集 和 排除 可以分别用两层循环嵌套 实现,将相同 或者 排除的 数字组成字符串显示到 text4和 text5