假设n=100.
一.Do While…游毁旅余宏LOOP实现
Dim i As Integer, sum As Integer
sum = 0: i = 1
Do While i <= 100
sum = sum + i
i = i + 1
Loop
二神凳.Do…Loop While实现:
Dim i As Integer, sum As Integer
sum = 0: i = 1
Do
sum = sum + i
i = i + 1
Loop While i <= 100
Print sum