VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 3900 ClientLeft = 60 ClientTop = 345 ClientWidth = 5310 LinkTopic = "Form1" ScaleHeight = 3900 ScaleWidth = 5310 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command1 Caption = "Выполнить" Height = 270 Left = 3570 TabIndex = 12 Top = 3570 Width = 1545 End Begin VB.PictureBox Picture5 Height = 270 Left = 3570 ScaleHeight = 210 ScaleWidth = 975 TabIndex = 11 Top = 3060 Width = 1035 End Begin VB.PictureBox Picture4 Height = 1290 Left = 2550 ScaleHeight = 1230 ScaleWidth = 2250 TabIndex = 9 Top = 1530 Width = 2310 End Begin VB.PictureBox Picture3 Height = 1290 Left = 0 ScaleHeight = 1230 ScaleWidth = 2250 TabIndex = 7 Top = 1530 Width = 2310 End Begin VB.PictureBox Picture2 Height = 270 Left = 2805 ScaleHeight = 210 ScaleWidth = 210 TabIndex = 5 Top = 765 Width = 270 End Begin VB.PictureBox Picture1 Height = 270 Left = 2040 ScaleHeight = 210 ScaleWidth = 210 TabIndex = 3 Top = 765 Width = 270 End Begin VB.TextBox Text1 Height = 285 Left = 0 TabIndex = 1 Text = "Text1" Top = 255 Width = 4605 End Begin VB.Label Label6 Caption = "Сумма элементов на главной диагонали:" Height = 270 Left = 0 TabIndex = 10 Top = 3060 Width = 3330 End Begin VB.Label Label5 Caption = "Полученный массив:" Height = 270 Left = 2550 TabIndex = 8 Top = 1275 Width = 1800 End Begin VB.Label Label4 Caption = "Исходный массив:" Height = 270 Left = 0 TabIndex = 6 Top = 1275 Width = 1545 End Begin VB.Label Label3 Caption = "X" Height = 270 Left = 2550 TabIndex = 4 Top = 765 Width = 270 End Begin VB.Label Label2 Caption = "Размерность массива:" Height = 270 Left = 0 TabIndex = 2 Top = 765 Width = 1800 End Begin VB.Label Label1 Caption = "Полное имя файла с данными: " Height = 270 Left = 0 TabIndex = 0 Top = 0 Width = 4095 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim Am(50, 50) As Double Private Sub Command1_Click() Picture1.Cls Picture2.Cls Picture3.Cls Picture4.Cls Picture5.Cls S = 0 File = Text1 Open File For Input As #1 Input #1, N Picture1.Print N Picture2.Print N For i = 0 To N - 1 For j = 0 To N - 1 Input #1, Am(i, j) Picture3.Print Format(Am(i, j), " 0.00"); Picture3.Print ("-----"); Next Picture3.Print Next Close #1 Sum = 0 For i = 0 To N - 1 Sum = Sum + Am(i, i) For j = 0 To N - 1 If Am(i, j) < Am(j, i) Then Am(j, i) = Am(i, j) Else Am(i, j) = Am(j, i) End If Next Next For i = 0 To N - 1 For j = 0 To N - 1 Picture4.Print Format(Am(i, j), "0.00"); Picture4.Print ("-----"); Next Picture4.Print Next Picture5.Print Sum End Sub