You are on page 1of 2

Cls

Print: Print: Print: Print: Print: Print: Print: Print:


Print: Print: Print: Print:

Do
N = Val(InputBox("Ingrese el n�mero de filas N: ", "N�mero de Filas", "Ingrese
Aqu� "))
If N = False Then
Exit Sub
End If
M = Val(InputBox("Ingrese el n�mero de columnas M: ", "N�mero de Columnas",
"Ingrese Aqu� "))
If M = False Then
Exit Sub
End If
If (N < 1 Or N > 7) Or (M < 1 Or M > 7) Then
MsgBox "ALERTA, valor m�ximo valor no admitido" & vbNewLine & "Por favor
ingrese un numero comprendido entre 1 y 7 para filas y columnas.", , "Informaci�n."
End If
Loop Until ((N > 1) And (M > 1) And (N < 8) And (M < 8))

For i = 1 To N
For j = 1 To M
a(i, j) = Val(InputBox("Ingrese el valor de a(" & i & " , " & j & " ) de la matriz
" & N & " x " & M, " Matrz posici�n : a(" & i & " , " & j & " )", "Ingrese Aqu�"))
If a(i, j) = False Then
Exit Sub
End If
Next j
Next i

For i = 1 To M
Print Tab(15 + (11 * i)); "Columna " & i;
Next i

s = 0
For i = 1 To N
may(i) = a(i, 1)
For j = 1 To M
If a(i, j) > may(i) Then
may(i) = a(i, j)
End If
Next j
s = s + may(i)
Next i

p = s / N

Print Tab(11 * M + 38); "Mayores";


Print:
Print:

For i = 1 To N
Print Tab(15); "Fila" & i;
For j = 1 To M
Print Tab(18 + (11 * j)); a(i, j);
Next j
Print Tab(11 * M + 38); may(i)
Print:
Next i

Print: Print:
Label123.Caption = "El Promedio de los n�meros mayores es: " & p

Command3.Visible = True
Command4.Visible = True
End Sub

You might also like