📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "最大公数"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4965
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4965
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 615
Left = 3600
TabIndex = 2
Top = 2280
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 360
TabIndex = 1
Text = "Text2"
Top = 1080
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 360
TabIndex = 0
Text = "Text1"
Top = 360
Width = 1695
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 m As Integer
Dim n As Integer
m = Text1.Text
n = Text2.Text
Caption = gcd(m, n)
End Sub
Private Function gcd(m As Integer, n As Integer) As Integer
Dim u As Integer
Dim v As Integer
Dim r As Integer
u = m
v = n
Do While v <> 0
r = u Mod v
u = v
v = r
Loop
gcd = u
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -