编程计算:S=1+2+3+...+100 方法一 : Private Sub Form_Click() Dim S%, I% S=0 ' 累加前变量 S 为 0 For I=1 to 100 ' For I=100 to 1 step -1 S=S+I Next I Print " S=",S End Sub 方法二 : Dim Sum As Integer , j As Integer Sum = 0 : j = 1 While j <= 100 Sum = Sum + j j = j + 1 Wend Print "Sum=";Sum 如果将 j = 100 ,那么 While 循环语句如何改写? Dim Sum As Integer, j As Integer Sum = 0: j = 100 While j >= 1 Sum = Sum + j j = j - 1 Wend Print "Sum="; Sum 方法三: Private Sub Command1_Click() Dim s As Integer, n As Integer s = 0: n = 1 Do While n <= 100 s = s + n n = n + 1 Loop Print "1+2+3+...+100 = " ;s End Sub 方法四: Private Sub Command1_Click() Dim s As Integer, n As Integer s = 0: n = 1 Do Until n > 100 s = s + n n = n + 1 Loop Print "1+2+3+...+100 = " ;s End Sub