Private Sub Command1_Click()
Dim sum, k, j, n As Integer
n = Val(Text1.Text)
sum = 0: k = 1
Do While k <= n
j = 1
Do While j <= k
sum = sum + 1: j = j + 1
Loop
k = k * 3
Text2.Text = CStr(sum)
End Sub
微信扫码预览、分享更方便