'交集求法
Dim nums1(12) as integer={第一组数字}
Dim nums2(12) as integer={第二组数字}
Dim jiao(12),point as integer
for i = 0 to 11
for j=0 to 11
if nums1(i)=nums2(j) then
jiao(point)=nums1(i)
point=point+1
next
next
'并集求法
Dim nums1(12) as integer={第一组数字}
Dim nums2(12) as integer={第二组数字}
Dim bing(24),point=12 as integer
for i = 0 to 11
bing(i)=nums1(i)
next
for j=0 to 11
for k=0 to 11
if nums2(j)=bing(k) then
continue for
else
bing(point)=nums2(j)
point=point+1
end if
next
next
数学概念,用代码来实现算法。