求完数的解法
核心部分:
Dim sum, temp As String
Dim i, j, m As Integer
For i = 1 To 1000
For j = 1 To i \ 2
If i Mod j = 0 Then
m = m + j
If temp = "" Then
temp = j
Else
temp = temp & "+" & CStr(j)
End If
End If
Next
If i = m Then
sum = sum + Str(m) + "=" + temp + Chr(13) + Chr(10)
End If
m = 0
temp = ""
Next
Label2.Text = sum
End Sub
[url=http://radio.gdqy.edu.cn]轻院广播台[/url]