gys.frm

来自「本程序是汇编语言的一些基本功能的组合」· FRM 代码 · 共 155 行

FRM
155 行
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "求两数的最大公约数"
   ClientHeight    =   2910
   ClientLeft      =   3990
   ClientTop       =   2895
   ClientWidth     =   4095
   LinkTopic       =   "Form1"
   ScaleHeight     =   2910
   ScaleWidth      =   4095
   Begin VB.CommandButton Command1 
      Caption         =   "显示结果"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   1320
      TabIndex        =   6
      Top             =   2400
      Width           =   1452
   End
   Begin VB.TextBox Text3 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   492
      Left            =   1920
      TabIndex        =   5
      Top             =   1680
      Width           =   1452
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   1920
      TabIndex        =   3
      Top             =   960
      Width           =   1452
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   1920
      TabIndex        =   2
      Top             =   240
      Width           =   1452
   End
   Begin VB.Label Label1 
      Caption         =   "最大公约数::"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Index           =   2
      Left            =   480
      TabIndex        =   4
      Top             =   1800
      Width           =   1692
   End
   Begin VB.Label Label1 
      Caption         =   "输入整数N:"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Index           =   1
      Left            =   480
      TabIndex        =   1
      Top             =   1080
      Width           =   1452
   End
   Begin VB.Label Label1 
      Caption         =   "输入整数M:"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   0
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   1575
   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()
Dim m As Integer
Dim n As Integer
Dim r As Integer
m = Val(Text1)
n = Val(Text2)
If n = 0 Then
 Text3 = "数据错误!"
Else
 r = m Mod n
 Do While r <> 0
   m = n
   n = r
   r = m Mod n
 Loop
 Text3 = n
End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?