Public Class Form1
'主程式
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i
For i = 1 To 10
f(i)
Next
End Sub
'副程式
Sub f(ByVal n)
Dim i
Dim s = 1
For i = 1 To n
s = s * i
Next
MsgBox(n & "!=" & s)
End Sub
End Class
沒有留言:
張貼留言