Dim sum As Integer
Dim i As Integer
sum = 0
For i = 1 To 100
If i Mod 2 = 0 Then
sum = sum + i
End If
Next
MsgBox "总计:" + cstr(sum)
Option Explicit
Dim sum As Integer
Dim i As Integer
Private Sub Command1_Click()
For i = 2 To 100 Step 2
sum = sum + i
Next
Print sum
End Sub
dim i as integer,j as integer
for i=1 to 100
if i mod 2=0 then
j=j+i
endif
next i
j就是和
for a=2 to 100 step 2
s=s+a
next
print S