s=4+9+13+18+...99
using for...next
do....loop until
while...wend
do while...loop
2007-01-09 16:26:12 · 1 個解答 · 發問者 夏 雨天 4 in 電腦與網際網路 ➔ 程式設計
Private Sub Command1_Click()
Dim i As Integer, j As Integer, a As Integer, s As Integer
i = 5: j = 4: a = 4: s = 0
Do
s = s + a
a = a + i
If (a <= 99) Then
s = s + a
End If
a = a + j
Loop While (a <= 99)
Print "sum = " & s
End sub
如果有問題, 請來函討論. 不然, 我可能會錯失你再補充的疑點.
2007-01-10 00:04:29 · answer #1 · answered by JJ 7 · 0⤊ 0⤋