vb中如何编程这个题 猴子吃桃(一天吃掉一半多一个,第二天吃掉盛下的

2024-11-24 16:01:32
推荐回答(2个)
回答1:

Private Sub Command1_Click()

s = 1

For i = 7 To 1 Step -1

s = 2 * s + 1

Next i

Print "桃子的数量="; s

End Sub

回答2:

Private Sub Command1_Click()
Dim a, s, d, k, i
a = 1
For i = 1 To 6

a = (a + 1) * 2
Next
Print a
最后等于190个