📄 删除相同数.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "删除相同数"
Height = 495
Left = 2160
TabIndex = 5
Top = 2640
Width = 2055
End
Begin VB.CommandButton Command1
Caption = "输入数据"
Height = 495
Left = 120
TabIndex = 4
Top = 2640
Width = 1335
End
Begin VB.PictureBox Picture2
Height = 975
Left = 1680
ScaleHeight = 915
ScaleWidth = 2475
TabIndex = 3
Top = 1320
Width = 2535
End
Begin VB.PictureBox Picture1
Height = 855
Left = 1680
ScaleHeight = 795
ScaleWidth = 2475
TabIndex = 2
Top = 240
Width = 2535
End
Begin VB.Label Label2
Caption = "结果数列"
Height = 855
Left = 120
TabIndex = 1
Top = 1440
Width = 1335
End
Begin VB.Label Label1
Caption = "原始数列"
Height = 615
Left = 240
TabIndex = 0
Top = 360
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a() As Integer
Private Sub Command1_Click()
Dim i As Integer
ReDim a(0 To 7) As Integer
For i = 0 To 7
a(i) = InputBox("")
Next i
For i = 0 To 7
Picture1.Print a(i);
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer, m As Integer, j As Integer
For i = 0 To 6
If a(i) <> -999 Then
For j = i + 1 To 7
If a(i) = a(j) Then
a(j) = -999
End If
Next j
End If
Next i
For m = 0 To UBound(a)
If a(m) <> -999 Then
Picture2.Print a(m);
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -