⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsort.frm

📁 快速排序和冒泡排序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSort 
   Caption         =   "Sorting"
   ClientHeight    =   3675
   ClientLeft      =   3015
   ClientTop       =   2865
   ClientWidth     =   5025
   LinkTopic       =   "Form1"
   ScaleHeight     =   3675
   ScaleWidth      =   5025
   Begin VB.CommandButton cmdexit 
      Caption         =   "E&xit"
      Height          =   375
      Left            =   2280
      TabIndex        =   15
      Top             =   1920
      Width           =   1215
   End
   Begin VB.CommandButton cmdBubble 
      Caption         =   "Bubble Sort"
      Height          =   375
      Left            =   2280
      TabIndex        =   5
      Top             =   1320
      Width           =   1215
   End
   Begin VB.CommandButton cmdQuickSort 
      Caption         =   "Quick Sort"
      Default         =   -1  'True
      Height          =   375
      Left            =   2280
      TabIndex        =   3
      Top             =   720
      Width           =   1215
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   13
      Left            =   360
      TabIndex        =   14
      Text            =   "1"
      Top             =   3120
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   12
      Left            =   360
      TabIndex        =   13
      Text            =   "1.2"
      Top             =   2880
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   11
      Left            =   360
      TabIndex        =   12
      Text            =   "1.5"
      Top             =   2640
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   10
      Left            =   360
      TabIndex        =   11
      Text            =   "6"
      Top             =   2400
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   9
      Left            =   360
      TabIndex        =   10
      Text            =   "1.2"
      Top             =   2160
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   8
      Left            =   360
      TabIndex        =   9
      Text            =   "5"
      Top             =   1920
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   7
      Left            =   360
      TabIndex        =   8
      Text            =   "6.4"
      Top             =   1680
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   6
      Left            =   360
      TabIndex        =   7
      Text            =   "6.3"
      Top             =   1440
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   5
      Left            =   360
      TabIndex        =   6
      Text            =   "5.876"
      Top             =   1200
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   4
      Left            =   360
      TabIndex        =   4
      Text            =   "5.877"
      Top             =   960
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   3
      Left            =   360
      TabIndex        =   2
      Text            =   "5.875"
      Top             =   720
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   2
      Left            =   360
      TabIndex        =   1
      Text            =   "4.56"
      Top             =   480
      Width           =   1095
   End
   Begin VB.TextBox txtS 
      Height          =   285
      Index           =   1
      Left            =   360
      TabIndex        =   0
      Text            =   "3"
      Top             =   240
      Width           =   1095
   End
End
Attribute VB_Name = "frmSort"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdBubble_Click()

Dim i As Integer
Dim Array1() As Double

ReDim Array1(1 To 13)

For i = 1 To 13
   Array1(i) = CDbl(txtS(i).Text)
Next i

Call BubbleSort(Array1)

For i = 1 To 13
   txtS(i).Text = CStr(Array1(i))
Next i

End Sub

Private Sub cmdexit_Click()
  End
End Sub

Private Sub cmdQuickSort_Click()

Dim i As Integer
Dim Array1() As Double

ReDim Array1(1 To 13)

For i = 1 To 13
   Array1(i) = CDbl(txtS(i).Text)
Next i

Call QuickSort(Array1)

For i = 1 To 13
   txtS(i).Text = CStr(Array1(i))
Next i

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -