求助func()函数
1+2+2的平方+2的3次方一直加下去,用func(x)=前面的相加,用这个表示值,谁能帮我编一下!
Public Function Func(x As Integer)
Dim Sum As Long, i As Integer
Sum = 0
For i = 0 To x
Sum = Sum + 2 ^ i
Next i
Func = Sum
End Function
这仅作提示参考,具体怎么实现要靠自己摸索...