VERSION 5.00 Object = "{FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.1#0"; "COMCT232.OCX" Begin VB.Form Form1 BorderStyle = 3 'Fixed Dialog Caption = "Массив" ClientHeight = 6180 ClientLeft = 5655 ClientTop = 3600 ClientWidth = 6255 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 6180 ScaleWidth = 6255 ShowInTaskbar = 0 'False Begin VB.CommandButton cmdFile Caption = "Запись в файл" Height = 495 Left = 4080 TabIndex = 16 Top = 120 Width = 2055 End Begin VB.Frame Frame2 Caption = "Выбор метода" Height = 1815 Left = 120 TabIndex = 10 Top = 3720 Width = 3855 Begin VB.OptionButton optShell Caption = "Метод Шелла" Height = 615 Left = 120 TabIndex = 13 Top = 1080 Width = 1695 End Begin VB.OptionButton optPuz Caption = "Метод пузырька" Height = 615 Left = 120 TabIndex = 12 Top = 480 Value = -1 'True Width = 1695 End Begin VB.Label lblTime2 Caption = "0" Height = 375 Left = 2160 TabIndex = 15 Top = 1200 Width = 1200 End Begin VB.Label lblTime1 Caption = "0" Height = 375 Left = 2160 TabIndex = 14 Top = 720 Width = 1575 End Begin VB.Label Label2 Caption = "Затраченное время" Height = 375 Left = 1920 TabIndex = 11 Top = 240 Width = 1695 End End Begin VB.CommandButton cmdVisual Caption = "Визуализация" Height = 495 Left = 4080 TabIndex = 9 Top = 1320 Width = 2055 End Begin VB.CommandButton cmdExp Caption = "Просмотр результата" Height = 495 Left = 4080 TabIndex = 8 Top = 720 Width = 2055 End Begin ComCtl2.UpDown UpDown1 Height = 375 Left = 2880 TabIndex = 7 Top = 240 Width = 255 _ExtentX = 423 _ExtentY = 661 _Version = 327681 Value = 500 BuddyControl = "txtCount" BuddyDispid = 196623 OrigLeft = 3120 OrigTop = 480 OrigRight = 3375 OrigBottom = 855 Increment = 50 Max = 5000 Min = 500 SyncBuddy = -1 'True BuddyProperty = 65547 Enabled = -1 'True End Begin VB.CommandButton cmdExit Caption = "Выход" Height = 495 Left = 4080 TabIndex = 6 ToolTipText = "Выход" Top = 1920 Width = 2055 End Begin VB.Frame Frame1 Caption = "Подсчет" Height = 2415 Left = 120 TabIndex = 2 Top = 1080 Width = 3855 Begin VB.CommandButton cmdStart Caption = "Пуск" Height = 495 Left = 840 TabIndex = 5 ToolTipText = "Пуск" Top = 1800 Width = 2175 End Begin VB.TextBox txtRezult Height = 495 Left = 240 TabIndex = 4 Top = 1080 Width = 3375 End Begin VB.TextBox txtData Height = 495 Left = 240 TabIndex = 3 Top = 480 Width = 3375 End End Begin VB.TextBox txtCount Height = 375 Left = 2280 TabIndex = 0 Text = "500" Top = 240 Width = 600 End Begin VB.Label Label1 Caption = "Количество элементов" Height = 495 Left = 240 TabIndex = 1 Top = 240 Width = 3375 End Begin VB.Menu mnuFile Caption = "Файл" Begin VB.Menu mnuGraf Caption = "График" End Begin VB.Menu mnuExit Caption = "Выход" Shortcut = {F11} End End Begin VB.Menu mnuHelp Caption = "Справка" Begin VB.Menu mnuHelpS Caption = "Создатель" End Begin VB.Menu mnuHelpO Caption = "О программе" End End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cmdExit_Click() End End Sub Private Sub cmdExp_Click() Form2.Show End Sub Private Sub cmdFile_Click() Form4.Show End Sub Private Sub cmdStart_Click() Dim Arr() As Integer n = Val(txtCount.Text) - 1 If n < 0 Then n = 0 ReDim Arr(n) txtData.Text = "" txtRezult.Text = "" lblTime = "" For x = 0 To n Arr(x) = Int(Rnd(9) * 10) txtData.Text = txtData.Text + Str(Arr(x)) Next If optPuz.Value Then tim = Timer For x = 0 To n - 1 For y = 0 To n - 1 If Arr(y) < Arr(y + 1) Then a = Arr(y) Arr(y) = Arr(y + 1) Arr(y + 1) = a End If Next Next tim = Timer - tim lblTime1 = Format(tim, "0.0000") For x = 0 To n txtRezult.Text = txtRezult.Text + Str(Arr(x)) Next x Else tim = Timer n = n g = (n + 1) \ 2 Do I = g Do J = I - g C = True Do If Arr(J) >= Arr(J + g) Then C = False Else Tmp = Arr(J) Arr(J) = Arr(J + g) Arr(J + g) = Tmp End If J = J - 1 Loop While (J >= 0 And C) I = I + 1 Loop While I <= n g = g \ 2 Loop While g > 0 tim = Timer - tim lblTime2 = Format(tim, "0.0000") For x = 0 To n txtRezult.Text = txtRezult.Text + Str(Arr(x)) Next x End If End Sub Private Sub cmdVisual_Click() Form3.Show End Sub Private Sub mnuExit_Click() Call cmdExit_Click End Sub Private Sub mnuGraf_Click() Form2.Show End Sub Private Sub mnuHelpO_Click() Form5.Show End Sub Private Sub mnuHelpS_Click() MsgBox "Курсовой проект разработанный студентом группы МС-106 Фахрутдиновым В. Н.", vbOKOnly + vbInformation, "Создатель" End Sub