' gambas module file
'by postapase abril 2016
Public Sub Main()
Print op.Maximo(30, 10, 5, 2, 2000, 500)'aquí podes poner mas números, desconozco el limite.
Print op.Minimo(30, 10, 5, 2, 2000, 500)
End
---------------------------------------------------
' gambas module file
'by postapase abril 2016
Private Lista As New Integer[]
Private a As Integer
Public Sub Maximo(...) As Integer
For Each a In Param
Lista.Add(a)
Next
Return Lista.Sort(True)[0]
End
Public Sub Minimo(...) As Integer
For Each a In Param
Lista.Add(a)
Next
Return Lista.Sort(True)[Lista.Max]
End
'by postapase abril 2016
Public Sub Main()
Print op.Maximo(30, 10, 5, 2, 2000, 500)'aquí podes poner mas números, desconozco el limite.
Print op.Minimo(30, 10, 5, 2, 2000, 500)
End
---------------------------------------------------
' gambas module file
'by postapase abril 2016
Private Lista As New Integer[]
Private a As Integer
Public Sub Maximo(...) As Integer
For Each a In Param
Lista.Add(a)
Next
Return Lista.Sort(True)[0]
End
Public Sub Minimo(...) As Integer
For Each a In Param
Lista.Add(a)
Next
Return Lista.Sort(True)[Lista.Max]
End
Código Fuente
