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