用while循环语句求出1+2+3.+100的和
问题描述:
用while循环语句求出1+2+3.+100的和
答
Sub aaa()
i = 0
While i a = a + i
i = i + 1
Wend
Debug.Print a
End Sub
Sub bbb()
i = 0
Do While i a = a + i
i = i + 1
Loop
Debug.Print a
End Sub
Sub ccc()
For i = 1 To 100
a = a + i
Next
Debug.Print a
End Sub