Facebook
From Innocent Leech, 1 Year ago, written in Plain Text.
This paste is a reply to Re: Re: Untitled from Cute Ibis - view diff
Embed
Download Paste or View Raw
Hits: 162
  1.  
  2. Module Module1
  3.     Function czyjest(ByVal n As Double, ByRef x() As Double, ByVal z As Double) As Double
  4.  
  5.         If n < 0 Then
  6.             Return n
  7.         ElseIf x(n) = z Then
  8.             Return n
  9.         Else
  10.             Return czyjest(n - 1, x, z)
  11.         End If
  12.  
  13.     End Function
  14.  
  15.     Sub Main()
  16.  
  17.         Dim x(100), n, z As Double
  18.  
  19.  
  20.         Console.WriteLine("podaj ilosc elementow: ")
  21.         n = Console.ReadLine()
  22.  
  23.         For i = 1 To n
  24.             Console.WriteLine("podaj element nr{0}: ", i)
  25.             x(i) = Console.ReadLine()
  26.         Next
  27.  
  28.         Console.WriteLine("podaj szukany element: ")
  29.         z = Console.ReadLine()
  30.  
  31.         Console.WriteLine("Pozycja: {0}", czyjest(n, x, z))
  32.  
  33.         Console.ReadKey()
  34.  
  35.  
  36.     End Sub
  37.  
  38. End Module
  39.  
  40.  
  41.  
  42.  
  43.