2017年5月5日 星期五
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim n = 720
Dim ss = "" & n
Dim i = 2
Dim isFirst = True
While i <= n
Dim c = 0
While n Mod i = 0
n = n \ i
c = c + 1
End While
If c > 0 Then
If c = 1 Then
If isFirst Then
ss = ss & "=" & i
isFirst = False
Else
ss = ss & "*" & i
End If
Else
If isFirst Then
ss = ss & "=" & i & "^" & c
isFirst = False
Else
ss = ss & "*" & i & "^" & c
End If
End If
End If
i = i + 1
End While
MsgBox(ss)
End Sub
End Class
訂閱:
文章 (Atom)