Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
43
Task/Array-concatenation/QB64/array-concatenation.qb64
Normal file
43
Task/Array-concatenation/QB64/array-concatenation.qb64
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
Dim As Integer First, Second
|
||||
First = 5: Second = 8
|
||||
|
||||
Dim As Integer Array1(1 To First), Array2(1 To Second), ArrayResult(1 To First + Second)
|
||||
|
||||
|
||||
Init Array1(), 2
|
||||
Print "First array"
|
||||
ShowArr Array1()
|
||||
Sleep 2
|
||||
Print "Second array"
|
||||
Init Array2(), 5
|
||||
ShowArr Array2()
|
||||
Sleep 2
|
||||
Print "Final array"
|
||||
|
||||
ConcatArray Array1(), Array2(), ArrayResult()
|
||||
ShowArr ArrayResult()
|
||||
End
|
||||
|
||||
Sub Init (A() As Integer, R As Integer)
|
||||
Dim Index As Integer
|
||||
For Index = 1 To UBound(a)
|
||||
A(Index) = Index * R
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub ShowArr (A() As Integer)
|
||||
Dim Index As Integer
|
||||
For Index = 1 To UBound(a)
|
||||
Print A(Index)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub ConcatArray (A() As Integer, B() As Integer, R() As Integer)
|
||||
Dim Index As Integer
|
||||
For Index = 1 To UBound(a)
|
||||
R(Index) = A(Index)
|
||||
Next
|
||||
For Index = (1) To (UBound(b))
|
||||
R(Index + UBound(a)) = B(Index)
|
||||
Next
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue