Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit On
- Option Strict On
- Public Class Form1
- Sub vvodM(ByRef a(,) As Double, ByVal l As ListBox)
- Dim i, j As Integer
- For i = 1 To a.GetLength(0) - 1
- For j = 1 To a.GetLength(1) - 1
- a(j, i) = CSng(Val(InputBox("Введите" & i & "," & j & "-й элемент ")))
- Next
- Next
- End Sub
- Sub vivodK(ByRef k() As Double, ByRef TB As TextBox)
- Dim i As Integer
- TB.Text = ""
- For i = 1 To UBound(k)
- TB.Text = TB.Text + CStr(k(i)) + Space(3)
- Next
- End Sub
- Sub vivodM(ByRef m(,) As Double, ByRef LB As ListBox)
- Dim x, y, i, j As Integer
- Dim z As String
- LB.Items.Clear()
- x = m.GetLength(0) - 1
- y = m.GetLength(1) - 1
- For i = 1 To x
- z = ""
- For j = 1 To y
- z = z + CStr(m(i, j)) + Space(3)
- Next
- LB.Items.Add(z)
- Next
- End Sub
- Sub getm(ByRef a(,) As Double, ByRef y() As Double)
- Dim i, j As Integer
- For i = 1 To a.GetLength(0) - 1
- y(i) = 1
- For j = 1 To a.GetLength(1) - 1
- If a(i, j) > 0 Then
- y(i) = a(i, j)
- Exit For
- End If
- Next
- Next
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim x(4, 4) As Double
- Dim y(4) As Double
- vvodM(x, ListBox1)
- vivodM(x, ListBox1)
- getm(x, y)
- vivodK(y, TextBox1)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement