7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command1_Click()
Dim i As Long
Dim j As Long
Dim s As Long
Dim text As String
For i = 1 To 1000
s = 0
text = "="
For j = 1 To i - 1
s = s + j
text = text & CStr(j) & "+"
If (s = i) Then
text = Left(text, Len(text) - 1)
Debug.Print (s & text)
Exit For
End If
Next
Next
End Sub