Sumatoria Diagonal Principal De Una Matriz

Páginas: 2 (367 palabras) Publicado: 19 de enero de 2013
Public GFila As Integer
Public GColumna As Integer
Public P1, P2 As Integer
Public A(GFila - 1, GColumna - 1)

Dim _txt As TextBox
Dim fila As Integer
Dim columnaAs Integer

Dim P1, P2 As Integer

'**********
' Dim A(1,1) as integer
Dim ValorAleatorio As Integer
Dim vf, vc As Integer
Dim random As NewRandom
P1 = 12
P2 = 52
fila = 0
columna = 0

fila = Valori.Text
columna = Valorj.Text

vf = fila - 1
vc = columna - 1ReDim A(vf, vc)
P2 = 52


For i As Integer = 1 To fila
P1 = P2

For j As Integer = 1 To columna

_txt = New TextBox_txt.Name = "text" & i & j
' _txt.text = "text F" & i & "c"& j
Dim numero As Integer = random.Next(1, 100)ValorAleatorio = numero
A(i - 1, j - 1) = ValorAleatorio
_txt.Text = A(i - 1, j - 1)
_txt.Location = New Point(P1, P2)
Me.Controls.Add(_txt)P1 = P1 + 127
Next j
P2 = P2 + 30
Next i
GFila = fila
GColumna = columna
'***************
'Suma Diagonal principal'Dim j As Integer

Dim suma As Integer
suma = 0

For i As Integer = 0 To GColumna - 1
j = i
suma = suma + A(i, j)
Next iMsgBox("La suma de la diagonal principal es = " & suma)
'En forma de espiral
For j As Integer = 0 To 2
Dim i As Integer
i = 0
Dim numero AsInteger
Numero = 20 Or 30 Or 40
A(i,j) = numero
Next j
For i As Integer = 1 To 2
Dim j As Integer
j = 2
Dim numero2 As Integer...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Matriz de la estrategia principal
  • matriz de la estrategia principal
  • sumatorias
  • Sumatoria De La Tabla De Pascal Y Matriz Infinita
  • Sumatoria
  • Sumatoria
  • sumatorias
  • SUMATORIAS

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS