form1.frm
来自「用vb做的冒泡法数组排序的程序」· FRM 代码 · 共 44 行
FRM
44 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4245
ClientLeft = 60
ClientTop = 345
ClientWidth = 5865
LinkTopic = "Form1"
ScaleHeight = 4245
ScaleWidth = 5865
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 2280
TabIndex = 0
Top = 3120
Width = 1095
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()
Static number(1 To 10)
For i = 1 To 10
number(i) = Val(InputBox("输入需排序的数据"))
Next i
For i = 10 To 2 Step -1
For j = 1 To i - 1
If number(j) > number(j + 1) Then
t = number(j + 1)
number(j + 1) = number(j)
number(j) = t
End If
Next j
Next i
For i = 1 To 10
Print number(i);
Next i
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?