今天我们上了第一节电脑程序设计课,老师风趣幽默,用直白诙谐的方法教会我们编程序的方法。下课之前,老师给我们布置了一个编写程序的作业,抄写了这些程序下来: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 = M
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
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 = M
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
虽然这段程序看似是十分简单,但当到了我们自己手里就不是那么简单了,开始时认真的抄写在电脑上,,但无论如何也没有做出应有的状态,一仔细检查我发现了问题,,不是大小写没有区分,就是写错公式,最离谱的是,竟然忘了把计算结果的空白留出来。。。。。
通过这次的学习和实践我发现了我自己的很多问题,,坚定了我以后好好学习程序设计的决心,,我以后一定要能自己编写程序.