Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Sub removeDuplicates(a() As Integer, b() As Integer)
|
||||
Dim lb As Integer = LBound(a)
|
||||
Dim ub As Integer = UBound(a)
|
||||
If ub = -1 Then Return '' empty array
|
||||
Redim b(lb To ub)
|
||||
b(lb) = a(lb)
|
||||
Dim count As Integer = 1
|
||||
Dim unique As Boolean
|
||||
|
||||
For i As Integer = lb + 1 To ub
|
||||
unique = True
|
||||
For j As Integer = lb to i - 1
|
||||
If a(i) = a(j) Then
|
||||
unique = False
|
||||
Exit For
|
||||
End If
|
||||
Next j
|
||||
If unique Then
|
||||
b(lb + count) = a(i)
|
||||
count += 1
|
||||
End If
|
||||
Next i
|
||||
|
||||
If count > 0 Then Redim Preserve b(lb To lb + count - 1)
|
||||
End Sub
|
||||
|
||||
Dim a(1 To 10) As Integer = {1, 2, 1, 4, 5, 2, 15, 1, 3, 4}
|
||||
Dim b() As Integer
|
||||
removeDuplicates a(), b()
|
||||
|
||||
For i As Integer = LBound(b) To UBound(b)
|
||||
Print b(i); " ";
|
||||
Next
|
||||
|
||||
Print
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue