form1.frm
来自「蒋加伏主编VB程序设计第四版PPT及全部课本源码 北京邮电大学出版社 」· FRM 代码 · 共 98 行
FRM
98 行
VERSION 5.00
Begin VB.Form Form1
Caption = "例[7-14] 合并排序"
ClientHeight = 2835
ClientLeft = 60
ClientTop = 345
ClientWidth = 5190
LinkTopic = "Form1"
ScaleHeight = 2835
ScaleWidth = 5190
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "合并"
Height = 375
Left = 2280
TabIndex = 6
Top = 2280
Width = 1095
End
Begin VB.PictureBox Picture3
Height = 615
Left = 1320
ScaleHeight = 555
ScaleWidth = 3555
TabIndex = 5
Top = 1440
Width = 3615
End
Begin VB.PictureBox Picture2
Height = 375
Left = 1320
ScaleHeight = 315
ScaleWidth = 3555
TabIndex = 4
Top = 840
Width = 3615
End
Begin VB.PictureBox Picture1
Height = 375
Left = 1320
ScaleHeight = 315
ScaleWidth = 3555
TabIndex = 3
Top = 240
Width = 3615
End
Begin VB.Label Label3
Caption = "合并后数组C"
Height = 255
Left = 120
TabIndex = 2
Top = 1560
Width = 1215
End
Begin VB.Label Label2
Caption = "数 组 B"
Height = 255
Left = 240
TabIndex = 1
Top = 960
Width = 855
End
Begin VB.Label Label1
Caption = "数 组 A"
Height = 375
Left = 240
TabIndex = 0
Top = 360
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer
Dim a(), b(), c(1000) As Variant
Private Sub Form_Load() '本过程完成a和b数组的赋值
a = Array(3, 5, 7, 9, 11, 14, 16)
b = Array(1, 2, 4, 6, 8, 10, 12, 13, 15, 80)
End Sub
Private Sub Command1_Click()
For i = 0 To UBound(a) '依次输出数组a
Picture1.Print a(i);
Next i
For i = 0 To UBound(b) '依次输出数组b
Picture2.Print b(i);
Next i
Call combin(a(), b(), c()) '过程调用,完成有序合并
For i = 0 To UBound(c) '本循环输出c数组
Picture3.Print c(i);
If (i + 1) Mod 10 = 0 Then Picture3.Print
Next i
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?