VERSION 5.00 Begin VB.Form Form1 BackColor = &H00000000& BorderStyle = 1 'Fixed Single Caption = "Решение систем уравнений" ClientHeight = 4080 ClientLeft = 45 ClientTop = 615 ClientWidth = 4710 Icon = "Form1.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 4080 ScaleWidth = 4710 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton Command6 BackColor = &H00808080& Caption = "Скрыть" Height = 255 Left = 1200 Style = 1 'Graphical TabIndex = 8 ToolTipText = "Спрятать содержимое LastAns" Top = 3720 Visible = 0 'False Width = 1095 End Begin VB.CommandButton Command5 BackColor = &H00808080& Caption = "Сохранить" Height = 255 Left = 120 Style = 1 'Graphical TabIndex = 7 ToolTipText = "Сохранить содержимое в LastAns" Top = 3720 Visible = 0 'False Width = 1095 End Begin VB.CommandButton Command8 BackColor = &H00808080& Caption = "Последний ответ" Height = 255 Left = 3000 Style = 1 'Graphical TabIndex = 10 ToolTipText = "Последний полученный ответ" Top = 1200 Width = 1575 End Begin VB.CommandButton Command7 BackColor = &H00808080& Caption = "Следующий ответ" Enabled = 0 'False Height = 255 Left = 1440 Style = 1 'Graphical TabIndex = 9 ToolTipText = "Следующий ответ из LastAns" Top = 1200 Width = 1575 End Begin VB.CommandButton Command2 BackColor = &H00808080& Caption = "Первый ответ" Height = 255 Left = 120 Style = 1 'Graphical TabIndex = 2 ToolTipText = "Первый ответ из LastAns" Top = 1200 Width = 1335 End Begin VB.CommandButton Command3 BackColor = &H00808080& Caption = "Решить массив" Enabled = 0 'False Height = 255 Left = 120 Style = 1 'Graphical TabIndex = 4 ToolTipText = "Решить систему уравнений" Top = 600 Width = 4455 End Begin VB.CommandButton Command4 BackColor = &H00808080& Caption = "Все ответы" Height = 255 Left = 240 Style = 1 'Graphical TabIndex = 6 ToolTipText = "Показать и редактировать LastAns" Top = 1560 Width = 1575 End Begin VB.TextBox Text2 BackColor = &H00000000& ForeColor = &H0000FF00& Height = 2175 Left = 120 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 5 ToolTipText = "Содержимое LastAns" Top = 1560 Visible = 0 'False Width = 4455 End Begin VB.PictureBox Picture1 BackColor = &H00000000& FillColor = &H0000FF00& ForeColor = &H0000FF00& Height = 255 Left = 120 ScaleHeight = 195 ScaleWidth = 4395 TabIndex = 3 ToolTipText = "Сюда выводится ответ" Top = 960 Width = 4455 End Begin VB.TextBox Text1 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00000000& ForeColor = &H0000FF00& Height = 285 Left = 1800 Locked = -1 'True MouseIcon = "Form1.frx":0CCA MousePointer = 1 'Arrow TabIndex = 1 TabStop = 0 'False Text = "gjhgkj" ToolTipText = "Ввести матрицу" Top = 165 Width = 1215 End Begin VB.Timer Timer2 Interval = 1000 Left = 1080 Top = 3120 End Begin VB.Timer Timer1 Left = 600 Top = 3120 End Begin VB.CommandButton Command1 BackColor = &H00000000& Caption = "Ввести данные" Height = 375 Left = 120 Style = 1 'Graphical TabIndex = 0 ToolTipText = "Ввести матрицу" Top = 120 Width = 4455 End Begin VB.Label Label1 BackStyle = 0 'Transparent BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FF00& Height = 2055 Left = 120 TabIndex = 11 ToolTipText = "Преобразованный массив" Top = 1920 Width = 4455 End Begin VB.Line Line3 BorderColor = &H00004040& BorderStyle = 3 'Dot Index = 1 X1 = 3480 X2 = 2400 Y1 = 4320 Y2 = 2160 End Begin VB.Line Line3 BorderColor = &H00004040& BorderStyle = 3 'Dot Index = 0 X1 = 1200 X2 = 2280 Y1 = 4320 Y2 = 2160 End Begin VB.Line Line1 BorderColor = &H000000FF& BorderWidth = 4 Index = 39 Visible = 0 'False X1 = 2205 X2 = 2220 Y1 = 2040 Y2 = 2040 End Begin VB.Line Line1 BorderColor = &H000000FF& BorderWidth = 4 Index = 38 Visible = 0 'False X1 = 2460 X2 = 2475 Y1 = 2040 Y2 = 2040 End Begin VB.Line Line2 BorderColor = &H00400040& X1 = 0 X2 = 4680 Y1 = 1800 Y2 = 1800 End Begin VB.Line Line1 BorderColor = &H0000FF00& Index = 37 Visible = 0 'False X1 = 2400 X2 = 2460 Y1 = 2040 Y2 = 2040 End Begin VB.Line Line1 BorderColor = &H0000FF00& Index = 36 Visible = 0 'False X1 = 2520 X2 = 2535 Y1 = 2160 Y2 = 2160 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 2 Index = 35 Visible = 0 'False X1 = 2640 X2 = 2655 Y1 = 2280 Y2 = 2280 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 2 Index = 34 Visible = 0 'False X1 = 2760 X2 = 2775 Y1 = 2400 Y2 = 2400 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 3 Index = 33 Visible = 0 'False X1 = 2880 X2 = 2895 Y1 = 2520 Y2 = 2520 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 3 Index = 32 Visible = 0 'False X1 = 3000 X2 = 3015 Y1 = 2640 Y2 = 2640 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 4 Index = 31 Visible = 0 'False X1 = 3120 X2 = 3135 Y1 = 2760 Y2 = 2760 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 4 Index = 30 Visible = 0 'False X1 = 3240 X2 = 3255 Y1 = 2880 Y2 = 2880 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 5 Index = 29 Visible = 0 'False X1 = 3360 X2 = 3375 Y1 = 3000 Y2 = 3000 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 5 Index = 28 Visible = 0 'False X1 = 3480 X2 = 3495 Y1 = 3120 Y2 = 3120 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 6 Index = 27 Visible = 0 'False X1 = 3600 X2 = 3615 Y1 = 3240 Y2 = 3240 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 6 Index = 26 Visible = 0 'False X1 = 3720 X2 = 3735 Y1 = 3360 Y2 = 3360 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 7 Index = 25 Visible = 0 'False X1 = 3840 X2 = 3855 Y1 = 3480 Y2 = 3480 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 7 Index = 24 Visible = 0 'False X1 = 3960 X2 = 3975 Y1 = 3600 Y2 = 3600 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 8 Index = 23 Visible = 0 'False X1 = 4080 X2 = 4095 Y1 = 3720 Y2 = 3720 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 8 Index = 22 Visible = 0 'False X1 = 4200 X2 = 4215 Y1 = 3840 Y2 = 3840 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 9 Index = 21 Visible = 0 'False X1 = 4320 X2 = 4335 Y1 = 3960 Y2 = 3960 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 9 Index = 20 Visible = 0 'False X1 = 4440 X2 = 4455 Y1 = 4080 Y2 = 4080 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 10 Index = 19 Visible = 0 'False X1 = 4560 X2 = 4575 Y1 = 4200 Y2 = 4200 End Begin VB.Line Line1 BorderColor = &H0000FF00& Index = 18 Visible = 0 'False X1 = 2285 X2 = 2240 Y1 = 2040 Y2 = 2040 End Begin VB.Line Line1 BorderColor = &H0000FF00& Index = 17 Visible = 0 'False X1 = 2160 X2 = 2175 Y1 = 2160 Y2 = 2160 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 2 Index = 16 Visible = 0 'False X1 = 2040 X2 = 2055 Y1 = 2280 Y2 = 2280 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 2 Index = 15 Visible = 0 'False X1 = 1920 X2 = 1935 Y1 = 2400 Y2 = 2400 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 3 Index = 14 Visible = 0 'False X1 = 1800 X2 = 1815 Y1 = 2520 Y2 = 2520 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 3 Index = 13 Visible = 0 'False X1 = 1680 X2 = 1695 Y1 = 2640 Y2 = 2640 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 4 Index = 12 Visible = 0 'False X1 = 1560 X2 = 1575 Y1 = 2760 Y2 = 2760 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 4 Index = 11 Visible = 0 'False X1 = 1440 X2 = 1455 Y1 = 2880 Y2 = 2880 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 5 Index = 10 Visible = 0 'False X1 = 1320 X2 = 1335 Y1 = 3000 Y2 = 3000 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 5 Index = 9 Visible = 0 'False X1 = 1200 X2 = 1215 Y1 = 3120 Y2 = 3120 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 6 Index = 8 Visible = 0 'False X1 = 1080 X2 = 1095 Y1 = 3240 Y2 = 3240 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 6 Index = 7 Visible = 0 'False X1 = 960 X2 = 975 Y1 = 3360 Y2 = 3360 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 7 Index = 6 Visible = 0 'False X1 = 840 X2 = 855 Y1 = 3480 Y2 = 3480 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 7 Index = 5 Visible = 0 'False X1 = 720 X2 = 735 Y1 = 3600 Y2 = 3600 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 8 Index = 4 Visible = 0 'False X1 = 600 X2 = 615 Y1 = 3720 Y2 = 3720 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 8 Index = 3 Visible = 0 'False X1 = 480 X2 = 495 Y1 = 3840 Y2 = 3840 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 9 Index = 2 Visible = 0 'False X1 = 360 X2 = 375 Y1 = 3960 Y2 = 3960 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 9 Index = 1 Visible = 0 'False X1 = 240 X2 = 255 Y1 = 4080 Y2 = 4080 End Begin VB.Line Line1 BorderColor = &H0000FF00& BorderWidth = 10 Index = 0 Visible = 0 'False X1 = 120 X2 = 135 Y1 = 4200 Y2 = 4200 End Begin VB.Line Line1 BorderColor = &H00008000& Index = 40 Visible = 0 'False X1 = 2160 X2 = 0 Y1 = 2160 Y2 = 4320 End Begin VB.Line Line1 BorderColor = &H00008000& Index = 41 Visible = 0 'False X1 = 2520 X2 = 4680 Y1 = 2160 Y2 = 4320 End Begin VB.Menu file Caption = "Файл" Begin VB.Menu lastans Caption = "Последний ответ" End Begin VB.Menu allans Caption = "Показать все ответы" End Begin VB.Menu d Caption = "-" End Begin VB.Menu Exit Caption = "Выход из программы" End End Begin VB.Menu mass Caption = "Данные" Begin VB.Menu unloadmas Caption = "Выгрузить массив" End Begin VB.Menu masedit Caption = "Редактор массивов..." End Begin VB.Menu kh Caption = "-" End Begin VB.Menu ans Caption = "Решить массив" Enabled = 0 'False End End Begin VB.Menu animat Caption = "Анимация" Begin VB.Menu graph Caption = "Разрешить графику" Checked = -1 'True Enabled = 0 'False End Begin VB.Menu stoper Caption = "Разрешить анимацию" Checked = -1 'True End End Begin VB.Menu help Caption = "Помощь" Begin VB.Menu what Caption = "Справка" End Begin VB.Menu final Caption = "Подробный отчет" End Begin VB.Menu errhelp Caption = "Если не работает справка или отчет" End Begin VB.Menu h Caption = "-" End Begin VB.Menu about Caption = "О программе" End End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim b As Integer, kk As Integer, s Private Sub about_Click() Form4.Show End Sub Private Sub allans_Click() If Command4.Visible = True Then Command4_Click Else Command6_Click End If End Sub Private Sub ans_Click() Command3_Click End Sub Private Sub Command1_Click() Command3.Enabled = True ans.Enabled = True Command7.Enabled = False Close Form2.Show Form1.Hide End Sub Private Sub Command2_Click() Command7.Enabled = False Close Open "files\lastans" For Append As #1 Print #1, "" Close Open "files\lastans" For Input As #1 Do While Not (EOF(1)) Line Input #1, strList If strList <> "" Then Picture1.Cls Picture1.Print strList Command7.Enabled = True GoTo 1: End If Loop 1: End Sub Private Sub Command3_Click() Command7.Enabled = False Command3.Enabled = False ans.Enabled = False Close Gauss End Sub Private Sub Command4_Click() Command7.Enabled = False Close Text2.Visible = True Command4.Visible = False Command5.Visible = True Command6.Visible = True Open "files\lastans" For Input As #1 Text2 = "" Do While Not (EOF(1)) Line Input #1, strList If strList <> "" Then Text2 = Text2 & strList & Chr(13) & Chr(10) End If Loop Close Open "files\lastans" For Output As #1 Print #1, Text2 Close End Sub Private Sub Command5_Click() Command7.Enabled = False Close Open "files\lastans" For Output As #3 Print #3, Text2 Close End Sub Private Sub Command6_Click() Text2.Visible = False Command4.Visible = True Command5.Visible = False Command6.Visible = False End Sub Private Sub Command7_Click() Do While Not (EOF(1)) Line Input #1, strList If strList <> "" Then Picture1.Cls Picture1.Print strList GoTo 1: End If Loop 1: End Sub Private Sub Command8_Click() lastans_Click End Sub Private Sub errhelp_Click() x = Shell("find", vbNormalFocus) End Sub Private Sub exit_Click() End End Sub Private Sub final_Click() x = Shell("files\full.bat", vbMinimizedFocus) End Sub Private Sub Form_Load() Text1 = Command1.Caption s = 0 End Sub Private Sub Form_Unload(Cancel As Integer) End End Sub Private Sub graph_Click() If graph.Checked = True Then For i = 18 To 41 Line1(i).Visible = False Next Line2.Visible = False Line3(0).Visible = False Line3(1).Visible = False graph.Checked = False Else Line2.Visible = True graph.Checked = True Line3(0).Visible = True Line3(1).Visible = True End If End Sub Private Sub lastans_Click() Command7.Enabled = False Close Open "files\lastans" For Append As #1 Print #1, "" Close Open "files\lastans" For Input As #1 Do While Not (EOF(1)) Line Input #1, strList If strList <> "" Then r = 1 Picture1.Cls Picture1.Print strList End If Loop Close #1 If r = 0 Then Picture1.Print "Ничего не помню" End Sub Private Sub load_Click() End Sub Private Sub masedit_Click() Command1_Click End Sub Private Sub stoper_Click() If stoper.Checked = True Then Timer2.Interval = 0 stoper.Checked = False graph.Enabled = True Else graph.Checked = False graph_Click graph.Enabled = False stoper.Checked = True Timer2.Interval = 1000 End If End Sub Private Sub Text1_Click() Command1_Click End Sub Private Sub Timer1_Timer() kk = kk + 1 If kk = 2 Then Line1(b).Visible = False Line1(b + 19).Visible = False b = b + 1 Line1(b).Visible = True Line1(b + 19).Visible = True If b = 18 Then Timer1.Interval = 0 End If kk = 0 End If End Sub Private Sub Timer2_Timer() b = 0 If s > 0 Then Timer1.Interval = 1 Line1(39).Visible = True Line1(38).Visible = True Line1(40).Visible = True Line1(41).Visible = True Else Line3(0).BorderColor = &HC0C0& Line3(1).BorderColor = &HC0C0& s = s + 1 End If End Sub Private Sub unloadmas_Click() ReDim mas(0, 0) As Double mas(0, 0) = 0 ReDim resh(0) As Variant resh(0) = "" Command3.Enabled = False ans.Enabled = False End Sub Private Sub Gauss() Command7.Enabled = False Close Picture1.Cls 'Функция, реализующая метод Гаусса For k = 0 To UBound(mas(), 2) - 2 'Ищем строку l с максимальным элементом в k-ом столбце l = -1 m = 0 For i = k To UBound(mas(), 2) - 1 If Abs(mas(i, k)) > m Then m = Abs(mas(i, k)) l = i End If Next 'Если у всех строк от k до n элемент в k-м столбце нулевой, то явного решения нет If l = -1 Then ReDim resh(0) As Variant resh(0) = "Одного решения нет" C = resh(0) Picture1.Cls Picture1.Print C GoTo 1 End If 'Меняем местом l-ую строку с k-ой If l <> k Then For j = 0 To UBound(mas(), 2) t = mas(k, j) mas(k, j) = mas(l, j) mas(l, j) = t Next End If 'Преобразуем матрицу For i = k + 1 To UBound(mas(), 2) - 1 q = mas(i, k) / mas(k, k) For j = 0 To UBound(mas(), 2) If j = k Then mas(i, j) = 0 Else mas(i, j) = mas(i, j) - q * mas(k, j) End If Next Next Next 'Вычисляем решение resh(UBound(mas(), 2) - 1) = mas(UBound(mas(), 2) - 1, UBound(mas(), 2)) / mas(UBound(mas(), 2) - 1, UBound(mas(), 2) - 1) For i = UBound(mas(), 2) - 2 To 0 Step -1 t = 0 For j = 0 To UBound(mas(), 2) - 1 - i t = t + mas(i, i + j) * resh(i + j) Next resh(i) = (mas(i, UBound(mas(), 2)) - t) / mas(i, i) Next For i = 0 To UBound(resh) C = C & Format(resh(i), "##0.000") & " " Next Picture1.Print C 1: Label1 = "" For i = 0 To UBound(mas(), 1) For j = 0 To UBound(mas(), 2) Label1 = Label1 & Format(mas(i, j), "##0.000") & " " Next Label1 = Label1 & Chr(13) & Chr(10) Next Open "files\lastans" For Append As #1 Print #1, C Close End Sub Private Sub what_Click() Command7.Enabled = False Close Open "files\help.pth" For Append As #1 Print #1, "" Close Open "files\help.pth" For Input As #1 Line Input #1, strList If strList <> "" Then End If If Dir(strList) = "help.htm" Then x = Shell("files\IEXPLORE " & strList, vbMaximizedFocus) Else MsgBox "Файл справки не найден", , "Ошибка" End If Close End Sub