📄 5-3.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5730
ClientLeft = 60
ClientTop = 405
ClientWidth = 4680
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 5730
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "处理"
Height = 495
Left = 2400
TabIndex = 5
Top = 4680
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "生成"
Height = 495
Left = 480
TabIndex = 4
Top = 4680
Width = 1095
End
Begin VB.ListBox List2
Height = 3210
ItemData = "5-3.frx":0000
Left = 2280
List = "5-3.frx":0002
TabIndex = 3
Top = 840
Width = 1575
End
Begin VB.ListBox List1
Height = 3210
ItemData = "5-3.frx":0004
Left = 360
List = "5-3.frx":0006
TabIndex = 1
Top = 840
Width = 1575
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "处理后:"
Height = 315
Left = 2400
TabIndex = 2
Top = 360
Width = 1260
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "原数组:"
Height = 315
Left = 480
TabIndex = 0
Top = 360
Width = 1260
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a(1 To 10) As Integer
Private Sub Command1_Click()
List1.Clear: List2.Clear
Dim i As Integer
For i = 1 To 10
a(i) = InputBox("请输入第" & i & "个数。")
List1.AddItem "No." & Format(i, "00") & ":" & a(i)
Next i
MsgBox "数据输入完毕,请单击'处理'!"
End Sub
Private Sub Command2_Click()
Dim max As Integer, imax As Integer
Dim min As Integer, imin As Integer
Dim i As Integer, temp As Integer
max = a(1): imax = 1: min = a(1): imin = 1
For i = 2 To 10
If a(i) > max Then max = a(i): imax = i
If a(i) < min Then min = a(i): imin = i
Next i
temp = a(imax): a(imax) = a(imin): a(imin) = temp
For i = 1 To 10
List2.AddItem "No." & Format(i, "00") & ":" & a(i)
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -