Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit On
  2. Option Strict On
  3.  
  4. Public Class Form1
  5.  
  6.     Sub vvodM(ByRef a(,) As Double, ByVal l As ListBox)
  7.         Dim i, j As Integer
  8.         For i = 1 To a.GetLength(0) - 1
  9.             For j = 1 To a.GetLength(1) - 1
  10.                 a(j, i) = CSng(Val(InputBox("Введите" & i & "," & j & "-й элемент ")))
  11.             Next
  12.         Next
  13.     End Sub
  14.  
  15.     Sub vivodK(ByRef k() As Double, ByRef TB As TextBox)
  16.         Dim i As Integer
  17.         TB.Text = ""
  18.         For i = 1 To UBound(k)
  19.             TB.Text = TB.Text + CStr(k(i)) + Space(3)
  20.         Next
  21.     End Sub
  22.  
  23.     Sub vivodM(ByRef m(,) As Double, ByRef LB As ListBox)
  24.         Dim x, y, i, j As Integer
  25.         Dim z As String
  26.         LB.Items.Clear()
  27.         x = m.GetLength(0) - 1
  28.         y = m.GetLength(1) - 1
  29.  
  30.         For i = 1 To x
  31.             z = ""
  32.             For j = 1 To y
  33.                 z = z + CStr(m(i, j)) + Space(3)
  34.             Next
  35.             LB.Items.Add(z)
  36.         Next
  37.     End Sub
  38.  
  39.  
  40.     Sub getm(ByRef a(,) As Double, ByRef y() As Double)
  41.         Dim i, j As Integer
  42.         For i = 1 To a.GetLength(0) - 1
  43.             y(i) = 1
  44.             For j = 1 To a.GetLength(1) - 1
  45.                 If a(i, j) > 0 Then
  46.                     y(i) = a(i, j)
  47.                     Exit For
  48.                 End If
  49.             Next
  50.         Next
  51.     End Sub
  52.  
  53.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  54.         Dim x(4, 4) As Double
  55.         Dim y(4) As Double
  56.         vvodM(x, ListBox1)
  57.         vivodM(x, ListBox1)
  58.         getm(x, y)
  59.         vivodK(y, TextBox1)
  60.     End Sub
  61.  
  62. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement