'求 N 的所有因數
Public Class Form1
Dim i
Dim str1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim n = 24
For i = 1 To 24
If n Mod i = 0 Then
str1 = str1 & i & " "
End If
Next
MsgBox(str1)
End Sub
End Class
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言