Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Option Strict On
Module Module1
Function ReadArr() As Double()
Dim n As Integer = CInt(Console.ReadLine())
Dim res(n - 1) As Double
For i As Integer = 0 To res.Length() - 1
res(i) = CDbl(Console.ReadLine())
Next
Return res
End Function
Sub Swap(ByVal arr() As Integer, ByVal i As Integer, ByVal j As Integer)
Dim temp As Integer = arr(i)
arr(i) = arr(j)
arr(j) = temp
End Sub
Sub Inverse(ByVal arr() As Integer)
Dim left As Integer = 0
Dim right As Integer = arr.Length - 1
While left < right
Swap(arr, left, right)
left += 1
right -= 1
End While
End Sub
Sub Main()
Dim arr() As Integer = ReadArr(arr)
End Sub
End Module
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more