'因數分解 -- 單一數
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim str1 = ""
Dim n = 369
Dim i = 2
While n <> 1
If n Mod i = 0 Then
str1 = str1 & i & Space(2)
n = n / i
Else
i = i + 1
End If
End While
MsgBox(str1)
End Sub
End Class
沒有留言:
張貼留言