Numeros de catalan

Páginas: 4 (843 palabras) Publicado: 3 de junio de 2010
Numeros de catalan (codigo)
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
inicio()
End SubPrivate Sub inicio()
Dim num As Integer = numerodeinicio()
TextBox1.Text = num
TextBox2.Text = numerodecatalan(num)
End Sub

Private Function numerodeinicio() AsInteger
Dim x As Integer
Do
x = InputBox("ingrese un numero entero")
If x < 0 Then
MsgBox("error, intente de nuevo", MsgBoxStyle.Critical)End If
Loop Until x >= 0
Return x

End Function
Private Function numerodecatalan(ByVal x As Integer) As String
Dim n As Integer
n = x
Ifn = 0
Return x

End Function
Private Function ventanainicio2()
Dim y As Integer
Do
y = InputBox("ahora ingrese numero k")
If y < 0 ThenMsgBox("error, intente de nuevo", MsgBoxStyle.Exclamation)
End If
Loop Until y >= 0
Return y
End Function
Private Functionnumerodestirling(ByVal x As Integer, ByVal y As Integer) As String
Dim n As Integer
Dim k As Integer
n = x
k = y
If n = k Then
Return 1
ElseIf n > 0And k = 0 Then
Return 0
ElseIf n > 0 Then
Return k * numerodestirling(n - 1, k) + numerodestirling(n - 1, k - 1)
Else
Return 0

End IfEnd Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Hide()
inicio()
Me.Show()
EndSub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub

Private Sub ProgressBar1_Click(ByVal sender As...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Numeros De Catalan
  • català
  • Catalan
  • Català
  • Catalán
  • catala
  • Català
  • Catalan

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS