VERSION 5.00 Begin VB.Form Form1 BorderStyle = 1 'Fixed Single Caption = "Form1" ClientHeight = 8175 ClientLeft = 45 ClientTop = 330 ClientWidth = 6975 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 8175 ScaleWidth = 6975 StartUpPosition = 2 'CenterScreen Begin VB.CheckBox Check1 Caption = "Решать сразу" Height = 255 Left = 120 TabIndex = 9 Top = 1600 Width = 1455 End Begin VB.CommandButton Command4 Caption = "Решить" Height = 255 Left = 120 TabIndex = 7 Top = 7800 Width = 6735 End Begin VB.CommandButton Command3 Caption = "Восстановить умолчания" Height = 255 Left = 120 TabIndex = 6 Top = 1320 Width = 6735 End Begin VB.CommandButton Command2 Caption = "RND" Height = 255 Left = 840 TabIndex = 5 Top = 1080 Width = 6015 End Begin VB.CommandButton Command1 Caption = "RND" Height = 255 Left = 120 TabIndex = 4 Top = 1080 Width = 735 End Begin VB.TextBox Text2 Height = 525 Left = 840 MultiLine = -1 'True ScrollBars = 1 'Horizontal TabIndex = 1 Top = 480 Width = 6015 End Begin VB.TextBox Text1 Alignment = 2 'Center BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 525 Left = 120 TabIndex = 0 Top = 480 Width = 735 End Begin VB.Label Label3 Alignment = 2 'Center Caption = "Массив" Height = 6015 Left = 120 TabIndex = 8 Top = 1680 Width = 6735 End Begin VB.Label Label2 Alignment = 2 'Center Caption = "Значения массива через "" """ Height = 255 Left = 840 TabIndex = 3 Top = 120 Width = 6015 End Begin VB.Label Label1 Alignment = 2 'Center BackStyle = 0 'Transparent Caption = "Порядок массива" Height = 375 Left = 120 TabIndex = 2 Top = 0 Width = 735 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim a As Integer, b As Double, c As String, d As Integer Dim mas() As Double, ver() As Double, resh() As Variant Private Sub Check1_Click() If Check1.Value = 1 Then Command4.Visible = False Else Command4.Visible = True End Sub Private Sub Command1_Click() Text1 = Fix(Rnd * 20 + 10) End Sub Private Sub Command2_Click() For i = 0 To Val(Text1) ^ 2 + Val(Text1) a = Fix(Rnd * 10) t = t & a & " " Next Text2 = t End Sub Private Sub Command3_Click() Text1 = 10 For i = 0 To 109 a = Fix(Rnd * 10) t = t & a & " " Next Text2 = t End Sub Private Sub Command4_Click() Gauss End Sub Private Sub Form_Load() Text1 = 10 For i = 0 To 109 a = Fix(Rnd * 10) t = t & a & " " Next Text2 = t d = 1 End Sub Private Sub Text1_Change() If Val(Text1) < 10 Then Text2.Enabled = False Command2.Enabled = False Else Text2.Enabled = True Command2.Enabled = True ReDim mas(Val(Text1) - 1, Val(Text1) - 1) As Double ReDim ver(Val(Text1) - 1) As Double ReDim resh(Val(Text1) - 1) As Variant End If a = 0 c = "Массив" av = Split(Text2, " ") If UBound(av) < 0 Or Val(Text1) < 10 Then GoTo 1 For i = 0 To Text1 - 1 c = c & Chr(10) & Chr(13) For j = 0 To Val(Text1) - 1 mas(i, j) = Val(av(a)) c = c & " " & mas(i, j) a = a + 1 If a > UBound(av) Then a = 0 Next ver(i) = Val(av(a)) c = c & " | " & ver(i) a = a + 1 If a > UBound(av) Then a = 0 Next Label3.Caption = c 1: If Command4.Visible = False Then Gauss End Sub Private Sub Text1_DblClick() Text1 = "" End Sub Private Sub Text2_Change() a = 0 c = "Массив" av = Split(Text2, " ") If UBound(av) < 0 Then GoTo 1 For i = 0 To Text1 - 1 c = c & Chr(10) & Chr(13) For j = 0 To Val(Text1) - 1 mas(i, j) = Val(av(a)) c = c & " " & mas(i, j) a = a + 1 If a > UBound(av) Then a = 0 Next ver(i) = Val(av(a)) c = c & " | " & ver(i) a = a + 1 If a > UBound(av) Then a = 0 Next Label3.Caption = c 1: If Command4.Visible = False Then Gauss End Sub Private Sub Text2_DblClick() Text2 = "" End Sub Sub Gauss() If d = 0 Then GoTo 1 k = 0 For t = 0 To Val(Text1) - 2 If mas(t, t) = 0 Then For i1 = t + 1 To Val(Text1) - 1 If mas(i1, t) <> 0 Then For j1 = 0 To Val(Text1) - 1 s = mas(i1, j1) mas(i1, j1) = mas(t, j1) mas(t, j1) = s Next s = ver(t) ver(t) = ver(i1) ver(i1) = s GoTo Nachalo Else If i1 = Val(Text1) - 1 Then resh(0) = "Единственного решения не существует" GoTo 1 End If End If Next End If Nachalo: For i = t + 1 To Val(Text1) - 2 b = mas(i, t) / mas(t, t) For j = t To Val(Text1) - 1 mas(i + 1, j) = mas(i + 1, j) - mas(i, j) * b Next ver(i + 1) = ver(i + 1) - ver(i) * b Next Next 1: End Sub