📄 最大公约数和最小公倍数.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "清空"
Height = 495
Left = 3240
TabIndex = 8
Top = 1680
Width = 735
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 3240
TabIndex = 7
Top = 2280
Width = 735
End
Begin VB.TextBox Text3
Height = 495
Left = 1200
TabIndex = 6
Text = "Text3"
Top = 2160
Width = 975
End
Begin VB.CommandButton Command1
Caption = "最小公倍数:"
Height = 495
Index = 1
Left = 120
TabIndex = 5
Top = 2400
Width = 855
End
Begin VB.CommandButton Command1
Caption = "最大公约数:"
Height = 495
Index = 0
Left = 120
TabIndex = 4
Top = 1920
Width = 855
End
Begin VB.TextBox Text2
Height = 495
Left = 1200
TabIndex = 3
Text = "Text2"
Top = 1080
Width = 975
End
Begin VB.TextBox Text1
Height = 495
Left = 1200
TabIndex = 2
Text = "Text1"
Top = 240
Width = 975
End
Begin VB.Label Label2
Caption = "数2:"
Height = 615
Left = 240
TabIndex = 1
Top = 1080
Width = 855
End
Begin VB.Label Label1
Caption = "数1:"
Height = 495
Left = 360
TabIndex = 0
Top = 240
Width = 735
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(Index As Integer)
Dim a, b As Integer
Dim p, m, r As Integer
a = Text1.Text
b = Text2.Text
If a < b Then
m = a: a = b: b = m
End If
p = a * b
Do While r <> 0
r = a Mod b
a = b
b = r
Loop
Select Case Index
Case 0
Text3.Text = p / a
Case 1
Text3.Text = a
End Select
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -