n = 10 Sum = 0 '累加求和时,变量的初值一定为0 prod = 1 '累乘(连乘)时,变量的初值一定为1 For i = 1 To n Sum = Sum + i prod = prod * i Next i Print Sum, prod