📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "实验5-6"
ClientHeight = 4155
ClientLeft = 60
ClientTop = 450
ClientWidth = 4110
LinkTopic = "Form1"
ScaleHeight = 4155
ScaleWidth = 4110
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 495
Left = 2640
TabIndex = 4
Top = 2160
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "清空"
Height = 495
Left = 2640
TabIndex = 3
Top = 1320
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "搜索"
Height = 495
Left = 2640
TabIndex = 2
Top = 480
Width = 1215
End
Begin VB.ListBox List1
Height = 2580
Left = 360
TabIndex = 0
Top = 360
Width = 1815
End
Begin VB.Label Label1
Height = 495
Left = 360
TabIndex = 1
Top = 3360
Width = 2415
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim a As Integer, b As Integer, i As Integer, j As Integer
Dim arr() As Integer
For a = 1 To 49
b = 99 - a
If a Mod 3 = 0 And b Mod 3 = 0 Then
i = i + 1
j = a
Do Until a Mod j = 0 And b Mod j = 0
j = j - 1
Loop
ReDim Preserve arr(3, i)
arr(1, i) = a
arr(2, i) = b
arr(3, i) = j
End If
Next
For j = 1 To i
List1.AddItem arr(1, j) & Str(arr(2, j)) & Str(arr(3, j))
Next j
Label1.Caption = "满足条件的数共" & CStr(i) & "对"
End Sub
Private Sub Command2_Click()
List1.Clear
Label1.Caption = ""
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -