📄 jmy.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00E0E0E0&
Caption = "冒泡排序"
ClientHeight = 11115
ClientLeft = 165
ClientTop = 450
ClientWidth = 7845
LinkTopic = "Form1"
ScaleHeight = 11115
ScaleWidth = 7845
StartUpPosition = 3 'Windows Default
Begin VB.TextBox text12
Appearance = 0 'Flat
BackColor = &H00FF0000&
BorderStyle = 0 'None
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF00&
Height = 615
Left = 120
TabIndex = 13
Text = "请输入需要排序的数:"
Top = 480
Width = 2895
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 495
Left = 4320
TabIndex = 12
Top = 9480
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "排序"
Height = 495
Left = 2280
TabIndex = 11
Top = 9480
Width = 1215
End
Begin VB.TextBox Text11
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 435
Left = 120
TabIndex = 10
Top = 10560
Width = 7575
End
Begin VB.TextBox Text10
Height = 375
Left = 3000
TabIndex = 9
Top = 8040
Width = 1215
End
Begin VB.TextBox Text9
Height = 375
Left = 3000
TabIndex = 8
Top = 7200
Width = 1215
End
Begin VB.TextBox Text8
Height = 375
Left = 3000
TabIndex = 7
Top = 6360
Width = 1215
End
Begin VB.TextBox Text7
Height = 375
Left = 3000
TabIndex = 6
Top = 5520
Width = 1215
End
Begin VB.TextBox Text6
Height = 375
Left = 3000
TabIndex = 5
Top = 4680
Width = 1215
End
Begin VB.TextBox Text5
Height = 375
Left = 3000
TabIndex = 4
Top = 3840
Width = 1215
End
Begin VB.TextBox Text4
Height = 375
Left = 3000
TabIndex = 3
Top = 3000
Width = 1215
End
Begin VB.TextBox Text3
Height = 375
Left = 3000
TabIndex = 2
Top = 2160
Width = 1215
End
Begin VB.TextBox Text2
Height = 375
Left = 3000
TabIndex = 1
Top = 1320
Width = 1215
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 375
Left = 3000
TabIndex = 0
Top = 480
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Rem a为数组(1-10)
Dim a(10) As Single
For i = 1 To 10
a(1) = Text1
a(2) = Text2
a(3) = Text3
a(4) = Text4
a(5) = Text5
a(6) = Text6
a(7) = Text7
a(8) = Text8
a(9) = Text9
a(10) = Text10
Next i
Dim w As Single
For i = 1 To 10
For j = i + 1 To 10
If a(i) > a(j) Then
w = a(i)
a(i) = a(j)
a(j) = w
End If
Rem 这里是从小到大排列,如果想从大到小,就把"<"改成">"
Next j, i
Dim c As String
For t = 1 To 10
c = a(1) & " " & a(2) & " " & a(3) & " " & a(4) & " " & a(5) & " " & a(6) & " " & a(7) & " " & a(8) & " " & a(9) & " " & a(10)
Next
Text11.Text = c
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -