很简单的求值题
日期:2006-09-02 荐:
很简单的求值题Dim I As Integer,S As Integers=0for=1 to 15 step3s=s Inext Iprint "sum= ";s我不是搞VB的,所以对VB的语法不熟悉,所以请大家帮忙解决一下,最后S=多少?谢谢!Dim I As Integer, S As IntegerS = 0For I = 1 To 15 Step 3S = S INext IMsgBox "sum = " & S结果sum = 35不熟悉VB语法,可以把代码放在vb中运行一次啊1 4 7 10 13=351 4 7 10 13这一部分是怎么得出来的?for=1 to 15 step3这一行写错了应为:for i=1 to 15 step 3结果:35step 3每次加3初始值是I=1,当然就是1 4 7 10 13
标签: