Private Sub Form_Click()
Dim i As Integer, sum As Integer
For i = 0.5 To 8.5 Step 2.5
sum = sum + i * 10
Next i
Print sum
Print i
End Sub
替我运算下啊 我怎么跟答案不对啊
谢谢
Private Sub Form_Click()
Dim i As Integer, sum As Integer
For i = 0.5 To 8.5 Step 2.5
sum = sum + i * 10
Next i
Print sum
Print i
End Sub
替我运算下啊 我怎么跟答案不对啊
谢谢
Private Sub Form_Click()
Dim i As Integer, sum As Integer
For i = 0.5 To 8.5 Step 2.5
sum = sum + i * 10
Print sum
Print i
Next i
End Sub
这样的话就一样了。
sum = 200
i = 10
i的取值0.5, 3, 5.5, 8
sum1=0.5*10=5
sum2=sum1+3*10=35
sum3=sum2+5.5*10=90
sum=sum3+8*10=170
最后等于170