GRACIAS NEBIRE
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim filas As Integer = 0
Dim tri As String = ""
filas = InputBox("INGRESE UN NUMERO MAYOR A 0", "VENTANA DE CARGA")
While (filas < 0)
MsgBox("Introduzca solo valores mayores a 0")
filas = InputBox("INGRESE UN NUMERO MAYOR A 0", "VENTANA DE CARGA")
End While
For n As Integer = 1 To filas
For i As Integer = 1 To n
If i = 1 Or i = n Or n = filas Then
tri = tri + "1 "
Else
tri = tri + "0 "
End If
Next
tri += vbNewLine
Next
MsgBox("Triángulo:" + vbNewLine + vbNewLine + tri)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim filas As Integer = 0
Dim tri As String = ""
filas = InputBox("INGRESE UN NUMERO MAYOR A 0", "VENTANA DE CARGA")
While (filas < 0)
MsgBox("Introduzca solo valores mayores a 0")
filas = InputBox("INGRESE UN NUMERO MAYOR A 0", "VENTANA DE CARGA")
End While
For n As Integer = 1 To filas
For i As Integer = 1 To n
If i = 1 Or i = n Or n = filas Then
tri = tri + "1 "
Else
tri = tri + "0 "
End If
Next
tri += vbNewLine
Next
MsgBox("Triángulo:" + vbNewLine + vbNewLine + tri)
End Sub