Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Sub Sort(a() As Integer)
- For index As Integer = 0 To a.Length - 2
- For scan As Integer = index + 1 To a.Length - 1
- If a(index) > a(scan) Then
- Dim temp As Integer = a(index)
- a(index) = a(scan)
- a(scan) = temp
- End If
- Next
- Next
- End Sub
- Sub Print(a() As Integer)
- For Each i As Integer In a
- Console.WriteLine(i)
- Next
- End Sub
- Sub Main()
- Dim ar() As Integer = {123, 235, 3, 123, 37, 123, 356, 123, 87, 978}
- Print(ar)
- Sort(ar)
- Print(ar)
- Console.ReadLine()
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement