Option Explicit
Private Sub Command1_Click()
Dim M As Integer
Dim N As Integer
M = Int(Val(Text1.Text))
N = Int(Val(Text2.Text))
Dim TemparyValue As Integer
If M < N Then
TemparyValue = N
M = N
N = TemparyValue
End If
Dim Remainder As Integer
Remainder = M Mod N
While Remainder <> 0
M = N
N = Remainder
Remainder = M Mod N
Wend
Label4.Caption = Str(N)
Private Sub Command1_Click()
Dim M As Integer
Dim N As Integer
M = Int(Val(Text1.Text))
N = Int(Val(Text2.Text))
Dim TemparyValue As Integer
If M < N Then
TemparyValue = N
M = N
N = TemparyValue
End If
Dim Remainder As Integer
Remainder = M Mod N
While Remainder <> 0
M = N
N = Remainder
Remainder = M Mod N
Wend
Label4.Caption = Str(N)
End Sub
输的好不容易,出现了很多细小的错误,后来在老师和同学的帮助下都改过来了,终于出来了结果!我感觉VB不简单,但是挺好玩的。
输的好不容易,出现了很多细小的错误,后来在老师和同学的帮助下都改过来了,终于出来了结果!我感觉VB不简单,但是挺好玩的。