Dana jest tablica 10 elementowa o nazwie tab(elementy sa numerowane 1->10.
Napisz fragment kodu zamieniajacy elementy o numerach a,b miejscami.
Mozesz wykorzystac zmienna pomocnicza
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
VB
Sub zamianatab(ByRef tablica() As Integer, ByVal a As Integer, ByVal b As Integer)
Dim c As Integer
If (UBound(tablica) - 1 > a) Or (UBound(tablica) - 1 > b) Then Exit Sub
c = tablica(a - 1)
a = tablica(b - 1)
b = c
End Sub