考试题目帮帮我
一个乒乓球从高为h 的地方落下,每次上升的距离为原来的一半,求n次后乒乓求经过的总路程.
Dim h, sum As Double
Dim a, n As Integer
h = CDbl(TextBox1.Text)
n = CInt(TextBox2.Text)
sum = h
For a = 1 To n
sum += h / 2
h = h / 2
Next